Spaces:
Sleeping
Sleeping
Delete weights.py
Browse files- weights.py +0 -26
weights.py
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import gdown
|
3 |
-
from pathlib import Path
|
4 |
-
|
5 |
-
def download_weights():
|
6 |
-
# Create directories if they don't exist
|
7 |
-
Path("weights/icon_detect").mkdir(parents=True, exist_ok=True)
|
8 |
-
Path("weights/icon_caption_florence").mkdir(parents=True, exist_ok=True)
|
9 |
-
|
10 |
-
# Correct file mapping with Drive file IDs and their corresponding local paths
|
11 |
-
files_to_download = {
|
12 |
-
"1hUCqZ3X8mcM-KcwWFjcsFg7PA0hUvE3k": "weights/icon_caption_florence/model.safetensors",
|
13 |
-
"1p-Y7rd0FfjNnv_jewCi7ZjXH3T-qtyAa": "weights/icon_detect/best.pt"
|
14 |
-
}
|
15 |
-
|
16 |
-
for file_id, output_path in files_to_download.items():
|
17 |
-
if not os.path.exists(output_path):
|
18 |
-
print(f"Downloading {output_path}...")
|
19 |
-
url = f"https://drive.google.com/uc?id={file_id}"
|
20 |
-
gdown.download(url, output_path, quiet=False)
|
21 |
-
print(f"Downloaded {output_path}")
|
22 |
-
else:
|
23 |
-
print(f"File {output_path} already exists, skipping download")
|
24 |
-
|
25 |
-
if __name__ == "__main__":
|
26 |
-
download_weights()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|