Spaces:
Sleeping
Sleeping
download improvements, model analysis
Browse files- training/birds/utils/kaggle.py +5 -1
- training/environment.yml +1 -1
- training/models/.gitignore +2 -0
- training/notebooks/lab.ipynb +0 -0
training/birds/utils/kaggle.py
CHANGED
@@ -34,16 +34,18 @@ def download_competition_data(competition: str, input_path: str | Path) -> None:
|
|
34 |
print(os.listdir(data_path))
|
35 |
|
36 |
|
37 |
-
def download_dataset(owner: str, dataset: str, input_path: str | Path) ->
|
38 |
"""
|
39 |
Downloads data from kaggle competition only if input folder is empty
|
40 |
:param comptetition: string with the competition name id of kaggle
|
41 |
:param input_path: path of the input folder
|
42 |
"""
|
|
|
43 |
data_path = Path(input_path)
|
44 |
if not data_path.exists():
|
45 |
data_path.mkdir(parents=True)
|
46 |
if not any(data_path.iterdir()):
|
|
|
47 |
api.dataset_download_files(f"{owner}/{dataset}", path=data_path)
|
48 |
with ZipFile(data_path / (dataset + ".zip"), "r") as zipObj:
|
49 |
# Extract all the contents of zip file in current directory
|
@@ -51,3 +53,5 @@ def download_dataset(owner: str, dataset: str, input_path: str | Path) -> None:
|
|
51 |
os.remove(data_path / (dataset + ".zip"))
|
52 |
|
53 |
print(os.listdir(data_path))
|
|
|
|
|
|
34 |
print(os.listdir(data_path))
|
35 |
|
36 |
|
37 |
+
def download_dataset(owner: str, dataset: str, input_path: str | Path) -> bool:
|
38 |
"""
|
39 |
Downloads data from kaggle competition only if input folder is empty
|
40 |
:param comptetition: string with the competition name id of kaggle
|
41 |
:param input_path: path of the input folder
|
42 |
"""
|
43 |
+
downloaded = False
|
44 |
data_path = Path(input_path)
|
45 |
if not data_path.exists():
|
46 |
data_path.mkdir(parents=True)
|
47 |
if not any(data_path.iterdir()):
|
48 |
+
downloaded = True
|
49 |
api.dataset_download_files(f"{owner}/{dataset}", path=data_path)
|
50 |
with ZipFile(data_path / (dataset + ".zip"), "r") as zipObj:
|
51 |
# Extract all the contents of zip file in current directory
|
|
|
53 |
os.remove(data_path / (dataset + ".zip"))
|
54 |
|
55 |
print(os.listdir(data_path))
|
56 |
+
|
57 |
+
return downloaded
|
training/environment.yml
CHANGED
@@ -10,7 +10,7 @@ dependencies:
|
|
10 |
- pip
|
11 |
- cudatoolkit=11.7
|
12 |
- pytorch==1.13.1
|
13 |
-
- torchvision
|
14 |
- pytorch-cuda=11.7
|
15 |
- fastcore=1.5.28
|
16 |
- fastai=2.7.11
|
|
|
10 |
- pip
|
11 |
- cudatoolkit=11.7
|
12 |
- pytorch==1.13.1
|
13 |
+
- torchvision==0.14.1
|
14 |
- pytorch-cuda=11.7
|
15 |
- fastcore=1.5.28
|
16 |
- fastai=2.7.11
|
training/models/.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
*
|
2 |
+
!.gitignore
|
training/notebooks/lab.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|