Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -97,7 +97,7 @@ def convert_seg_to_bbox(api_key: str, dataset_url: str):
|
|
97 |
if not os.path.isfile(src):
|
98 |
continue
|
99 |
shutil.copy(src, os.path.join(img_out, fname))
|
100 |
-
with open(os.path.join(lbl_out, fname.rsplit('.',1)[0]+".txt"), 'w') as lf:
|
101 |
lf.write("\n".join(annos.get(img_id, [])))
|
102 |
|
103 |
# build before/after samples
|
@@ -152,12 +152,18 @@ def upload_and_train_detection(
|
|
152 |
)
|
153 |
|
154 |
# upload the YOLO dataset
|
155 |
-
ws.upload_dataset(
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
158 |
|
159 |
-
# generate a new version (must pass
|
160 |
-
version_num = proj.generate_version(settings={
|
|
|
|
|
|
|
161 |
|
162 |
# train it
|
163 |
proj.version(str(version_num)).train()
|
|
|
97 |
if not os.path.isfile(src):
|
98 |
continue
|
99 |
shutil.copy(src, os.path.join(img_out, fname))
|
100 |
+
with open(os.path.join(lbl_out, fname.rsplit('.',1)[0] + ".txt"), 'w') as lf:
|
101 |
lf.write("\n".join(annos.get(img_id, [])))
|
102 |
|
103 |
# build before/after samples
|
|
|
152 |
)
|
153 |
|
154 |
# upload the YOLO dataset
|
155 |
+
ws.upload_dataset(
|
156 |
+
dataset_path,
|
157 |
+
project_slug,
|
158 |
+
project_license=project_license,
|
159 |
+
project_type=project_type
|
160 |
+
)
|
161 |
|
162 |
+
# generate a new version (must pass both keys—even if empty)
|
163 |
+
version_num = proj.generate_version(settings={
|
164 |
+
"augmentation": {},
|
165 |
+
"preprocessing": {},
|
166 |
+
})
|
167 |
|
168 |
# train it
|
169 |
proj.version(str(version_num)).train()
|