Skip to content

Commit

Permalink
Update ocr.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMattBin authored May 5, 2024
1 parent ac07e7c commit 2b25cdd
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) -> 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 2b25cdd

Please sign in to comment.