Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,24 +4,6 @@ import requests
|
|
| 4 |
import os
|
| 5 |
from ultralytics import YOLO
|
| 6 |
|
| 7 |
-
# Downloading the necessary files
|
| 8 |
-
file_urls = [
|
| 9 |
-
'https://www.dropbox.com/scl/fi/kqd1z6wby1212c6ndodb3/Pol_20_jpg.rf.133c835b66958a7d48c12deeda31a719.jpg?rlkey=uqgvs2cwvahnmju15fv1zgorg&st=snv2yvtk&dl=0',
|
| 10 |
-
'https://www.dropbox.com/scl/fi/39aakapeh2y5ztk94rsyu/11e-a347-3f2d_jpg.rf.c66e5aeb57ee2ed660fdf0162156127d.jpg?rlkey=xoi3iw45vksgiejycau2ha7fh&st=etiawigv&dl=0',
|
| 11 |
-
'https://www.dropbox.com/scl/fi/8f08ehy53vsemw164g8n7/Recording2024-06-26184319.mp4?rlkey=pnmov906ttodl0cm92rpvc5ta&st=2twc9pjn&dl=0'
|
| 12 |
-
]
|
| 13 |
-
|
| 14 |
-
def download_file(url, save_name):
|
| 15 |
-
if not os.path.exists(save_name):
|
| 16 |
-
file = requests.get(url)
|
| 17 |
-
open(save_name, 'wb').write(file.content)
|
| 18 |
-
|
| 19 |
-
for i, url in enumerate(file_urls):
|
| 20 |
-
if url.endswith('.mp4'):
|
| 21 |
-
download_file(url, "video.mp4")
|
| 22 |
-
else:
|
| 23 |
-
download_file(url, f"image_{i}.jpg")
|
| 24 |
-
|
| 25 |
# Define the colors for different classes
|
| 26 |
colors = {
|
| 27 |
0: (255, 0, 0), # Red for class 0
|
|
|
|
| 4 |
import os
|
| 5 |
from ultralytics import YOLO
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
# Define the colors for different classes
|
| 8 |
colors = {
|
| 9 |
0: (255, 0, 0), # Red for class 0
|