Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,10 +13,11 @@ logging.basicConfig(level=logging.INFO)
|
|
| 13 |
os.makedirs("debug_outputs", exist_ok=True)
|
| 14 |
|
| 15 |
# Path to the YOLOv8 model
|
| 16 |
-
model_path = "yolov8-license-plate.pt" #
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
# Automatically download model if it doesn't exist
|
| 20 |
if not os.path.exists(model_path):
|
| 21 |
print(f"Downloading model weights from {download_url}...")
|
| 22 |
response = requests.get(download_url)
|
|
@@ -24,7 +25,7 @@ if not os.path.exists(model_path):
|
|
| 24 |
f.write(response.content)
|
| 25 |
|
| 26 |
# Load the model (either downloaded or pre-existing)
|
| 27 |
-
model = YOLO(model_path)
|
| 28 |
|
| 29 |
# PaddleOCR for text recognition
|
| 30 |
ocr = PaddleOCR(use_angle_cls=True, lang='en')
|
|
|
|
| 13 |
os.makedirs("debug_outputs", exist_ok=True)
|
| 14 |
|
| 15 |
# Path to the YOLOv8 model
|
| 16 |
+
model_path = "yolov8-license-plate.pt" # Replace this with your correct model path or URL
|
| 17 |
+
|
| 18 |
+
# If model is not available, download it (replace the URL with the correct one)
|
| 19 |
+
download_url = "https://your-model-url.com/your-model.pt" # Replace with actual URL
|
| 20 |
|
|
|
|
| 21 |
if not os.path.exists(model_path):
|
| 22 |
print(f"Downloading model weights from {download_url}...")
|
| 23 |
response = requests.get(download_url)
|
|
|
|
| 25 |
f.write(response.content)
|
| 26 |
|
| 27 |
# Load the model (either downloaded or pre-existing)
|
| 28 |
+
model = YOLO(model_path)
|
| 29 |
|
| 30 |
# PaddleOCR for text recognition
|
| 31 |
ocr = PaddleOCR(use_angle_cls=True, lang='en')
|