Spaces:
Runtime error
Runtime error
Update Remaining_test.py
Browse files- Remaining_test.py +4 -2
Remaining_test.py
CHANGED
|
@@ -3,9 +3,11 @@ import cv2
|
|
| 3 |
import numpy as np
|
| 4 |
import easyocr
|
| 5 |
from ultralytics import YOLO
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
def draw_obb(image, obb):
|
| 11 |
boxes = obb.xyxyxyxy.cpu().numpy()
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import easyocr
|
| 5 |
from ultralytics import YOLO
|
| 6 |
+
import os
|
| 7 |
|
| 8 |
+
cache_dir = "/tmp/easyocr-model"
|
| 9 |
+
os.makedirs(cache_dir, exist_ok=True)
|
| 10 |
+
reader = easyocr.Reader(['en'], model_storage_directory=cache_dir)
|
| 11 |
|
| 12 |
def draw_obb(image, obb):
|
| 13 |
boxes = obb.xyxyxyxy.cpu().numpy()
|