Skip to content

Commit

Permalink
Merge pull request #24 from supervisely-ecosystem/rollback
Browse files Browse the repository at this point in the history
Rollback v3.2.0 → v3.1.6
  • Loading branch information
GoldenAnpu authored Dec 4, 2024
2 parents 9a182a3 + b2fd3aa commit 484659e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 36 deletions.
54 changes: 30 additions & 24 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
{
"name": "Export to Supervisely format",
"type": "app",
"version": "2.0.0",
"categories": ["images", "export"],
"description": "images and JSON annotations",
"docker_image": "supervisely/import-export:6.73.248",
"instance_version": "6.12.12",
"main_script": "src/main.py",
"modal_template": "src/modal.html",
"modal_template_state": {
"download": "all",
"fixExtension": false
},
"task_location": "workspace_tasks",
"isolate": true,
"headless": true,
"icon": "https://i.imgur.com/1hqGMyg.png",
"icon_background": "#FFFFFF",
"context_menu": {
"target": ["images_project", "images_dataset"],
"context_root": "Download as"
},
"poster": "https://user-images.githubusercontent.com/106374579/186665737-ec3da9cc-193f-43ee-85db-a6f802b2dfe4.png"
}
"name": "Export to Supervisely format",
"type": "app",
"version": "2.0.0",
"categories": [
"images",
"export"
],
"description": "images and JSON annotations",
"docker_image": "supervisely/import-export:6.73.162",
"instance_version": "6.11.8",
"main_script": "src/main.py",
"modal_template": "src/modal.html",
"modal_template_state": {
"download": "all",
"fixExtension": false
},
"task_location": "workspace_tasks",
"isolate": true,
"headless": true,
"icon": "https://i.imgur.com/1hqGMyg.png",
"icon_background": "#FFFFFF",
"context_menu": {
"target": [
"images_project",
"images_dataset"
],
"context_root": "Download as"
},
"poster": "https://user-images.githubusercontent.com/106374579/186665737-ec3da9cc-193f-43ee-85db-a6f802b2dfe4.png"
}
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
supervisely==6.73.248
supervisely==6.73.162
13 changes: 2 additions & 11 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import os
from distutils import util

Expand Down Expand Up @@ -122,24 +121,16 @@ def download(project: sly.Project) -> str:

sly.logger.info(f"Starting download of project {project.name} to {download_dir}...")

loop = sly.fs.get_or_create_event_loop()
coro = sly.Project.download_async(
sly.Project.download(
api,
project_id,
dest_dir=download_dir,
dataset_ids=dataset_ids,
log_progress=True,
batch_size=batch_size,
save_image_meta=True,
save_images=save_images,
)
if loop.is_running():
sly.logger.debug("Loop is already running, using run_coroutine_threadsafe")
future = asyncio.run_coroutine_threadsafe(coro, loop)
future.result()
else:
sly.logger.debug("Loop is not running, using run_until_complete")
loop.run_until_complete(coro)

meta_path = os.path.join(download_dir, "meta.json")
meta = sly.ProjectMeta.from_json(sly.json.load_json_file(meta_path))
if any(obj_cls.geometry_type == sly.Cuboid2d for obj_cls in meta.obj_classes):
Expand Down

0 comments on commit 484659e

Please sign in to comment.