TheKnight115 commited on
Commit
f748b36
·
verified ·
1 Parent(s): cb33815

Update processor.py

Browse files
Files changed (1) hide show
  1. processor.py +3 -3
processor.py CHANGED
@@ -44,9 +44,9 @@ class_colors = {
44
  5: (0, 255, 255), # Yellow (Person)
45
  }
46
 
47
- # Initialize the OCR pipeline
48
- # Replace 'stepfun-ai/GOT-OCR2_0' with the correct model name if different
49
- ocr_pipeline = pipeline("image-to-text", model="stepfun-ai/GOT-OCR2_0", trust_remote_code=True, device=0 if torch.cuda.is_available() else -1)
50
 
51
  # Load YOLO model
52
  # Ensure the path to the model is correct
 
44
  5: (0, 255, 255), # Yellow (Person)
45
  }
46
 
47
+ # Load the OCR model
48
+ processor = AutoProcessor.from_pretrained("stepfun-ai/GOT-OCR2_0", trust_remote_code=True)
49
+ model_ocr = AutoModel.from_pretrained("stepfun-ai/GOT-OCR2_0", trust_remote_code=True).to('cuda')
50
 
51
  # Load YOLO model
52
  # Ensure the path to the model is correct