MCPcopy Create free account
hub / github.com/LCBOWER33/StegoScan / extract_text

Function extract_text

StegoScan.py:706–711  ·  view source on GitHub ↗

Run OCR and return meaningful extracted text.

(image, processor, model)

Source from the content-addressed store, hash-verified

704
705
706def extract_text(image, processor, model):
707 """Run OCR and return meaningful extracted text."""
708 pixel_values = processor(image, return_tensors="pt").pixel_values
709 generated_ids = model.generate(pixel_values)
710 extracted_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
711 return extracted_text if is_meaningful_text(extracted_text) else None
712
713
714def detect_objects(image):

Callers 1

audio_dectectionFunction · 0.85

Calls 1

is_meaningful_textFunction · 0.85

Tested by

no test coverage detected