Spaces:
Build error
Build error
Rename adanalyst_mar30_logo (1).py to app.py
Browse files
adanalyst_mar30_logo (1).py → app.py
RENAMED
|
@@ -477,11 +477,12 @@ def perform_object_detection(image_pil):
|
|
| 477 |
"""## Logo"""
|
| 478 |
|
| 479 |
# Commented out IPython magic to ensure Python compatibility.
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
|
|
|
| 485 |
logo_model.conf = 0.25
|
| 486 |
|
| 487 |
def detect_logos(pil_image):
|
|
|
|
| 477 |
"""## Logo"""
|
| 478 |
|
| 479 |
# Commented out IPython magic to ensure Python compatibility.
|
| 480 |
+
if not os.path.exists("yolov7"):
|
| 481 |
+
with zipfile.ZipFile("yolov7.zip", 'r') as zip_ref:
|
| 482 |
+
zip_ref.extractall(".")
|
| 483 |
+
print("files", os.listdir("."))
|
| 484 |
+
sys.path.append("./yolov7")
|
| 485 |
+
logo_model = torch.hub.load('./yolov7', 'custom', './logo_detection.pt', source='local')
|
| 486 |
logo_model.conf = 0.25
|
| 487 |
|
| 488 |
def detect_logos(pil_image):
|