Spaces:
Sleeping
Sleeping
Update processor.py
Browse files- processor.py +2 -8
processor.py
CHANGED
@@ -184,10 +184,7 @@ def process_video(video_path, font_path, violation_image_path='violation.jpg'):
|
|
184 |
license_plate_pil = Image.fromarray(cv2.cvtColor(license_crop, cv2.COLOR_BGR2RGB))
|
185 |
temp_image_path = 'license_plate.png'
|
186 |
license_plate_pil.save(temp_image_path)
|
187 |
-
|
188 |
-
# license_plate_text = model_ocr.chat(processor, temp_image_path, ocr_type='ocr')
|
189 |
-
# For demonstration, we'll mock the OCR result
|
190 |
-
license_plate_text = "1234AB"
|
191 |
filtered_text = filter_license_plate_text(license_plate_text)
|
192 |
|
193 |
if filtered_text:
|
@@ -268,10 +265,7 @@ def process_image(image_path, font_path, violation_image_path='violation.jpg'):
|
|
268 |
license_plate_pil = Image.fromarray(cv2.cvtColor(license_crop, cv2.COLOR_BGR2RGB))
|
269 |
temp_image_path = 'license_plate.png'
|
270 |
license_plate_pil.save(temp_image_path)
|
271 |
-
|
272 |
-
# license_plate_text = model_ocr.chat(processor, temp_image_path, ocr_type='ocr')
|
273 |
-
# For demonstration, we'll mock the OCR result
|
274 |
-
license_plate_text = "1234AB"
|
275 |
filtered_text = filter_license_plate_text(license_plate_text)
|
276 |
|
277 |
if filtered_text:
|
|
|
184 |
license_plate_pil = Image.fromarray(cv2.cvtColor(license_crop, cv2.COLOR_BGR2RGB))
|
185 |
temp_image_path = 'license_plate.png'
|
186 |
license_plate_pil.save(temp_image_path)
|
187 |
+
license_plate_text = model_ocr.chat(processor, temp_image_path, ocr_type='ocr')
|
|
|
|
|
|
|
188 |
filtered_text = filter_license_plate_text(license_plate_text)
|
189 |
|
190 |
if filtered_text:
|
|
|
265 |
license_plate_pil = Image.fromarray(cv2.cvtColor(license_crop, cv2.COLOR_BGR2RGB))
|
266 |
temp_image_path = 'license_plate.png'
|
267 |
license_plate_pil.save(temp_image_path)
|
268 |
+
license_plate_text = model_ocr.chat(processor, temp_image_path, ocr_type='ocr')
|
|
|
|
|
|
|
269 |
filtered_text = filter_license_plate_text(license_plate_text)
|
270 |
|
271 |
if filtered_text:
|