Skip to content

Commit

Permalink
upload images as links
Browse files Browse the repository at this point in the history
  • Loading branch information
almazgimaev committed Jun 27, 2024
1 parent c45689e commit 181a8e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dev_requirements.txt → requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
supervisely==6.73.110
# git+https://github.com/supervisely/supervisely.git@friendly-import
# supervisely==6.73.110
git+https://github.com/supervisely/supervisely.git@import-wizard-updates-7

# for coco dataset
pycocotools
Expand Down
2 changes: 2 additions & 0 deletions src/globals.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import os

from distutils.util import strtobool
from dotenv import load_dotenv

import supervisely as sly
Expand All @@ -21,6 +22,7 @@
project_id = sly.env.project_id()
dataset_id = sly.env.dataset_id(raise_not_found=False)

import_as_links = bool(strtobool(os.environ.get("modal.state.importAsLinks", "false")))
default_ds_name = f"dataset {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}"
dataset_name = os.environ.get("modal.state.datasetName", default_ds_name)
if dataset_name == "":
Expand Down
5 changes: 4 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
if g.input_path is None:
raise Exception("Please, provide data to import.")
importer = sly.ImportManager(
g.input_path, g.project_modality, labeling_interface=labeling_interface
g.input_path,
g.project_modality,
labeling_interface=labeling_interface,
upload_as_links=g.import_as_links,
)
except Exception as e:
f.handle_exception_and_stop(e, "Failed to detect format")
Expand Down

0 comments on commit 181a8e3

Please sign in to comment.