Skip to content

Commit

Permalink
Merge pull request #88 from TheMattBin/master
Browse files Browse the repository at this point in the history
Update ocr.py
  • Loading branch information
VikParuchuri authored May 8, 2024
2 parents 0bb1de4 + 2b25cdd commit ef5a333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion surya/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def run_recognition(images: List[Image.Image], langs: List[List[str]], rec_model

def run_ocr(images: List[Image.Image], langs: List[List[str]], det_model, det_processor, rec_model, rec_processor, batch_size=None) -> List[OCRResult]:
det_predictions = batch_text_detection(images, det_model, det_processor)
if det_model.device == "cuda":
if det_model.device.type == "cuda":
torch.cuda.empty_cache() # Empty cache from first model run

slice_map = []
Expand Down

0 comments on commit ef5a333

Please sign in to comment.