Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src/superannotate/lib/app/interface/sdk_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,12 @@ def attach_image_urls_to_project(
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
list_of_uploaded = []

logger.info("Attaching %s images to project.", len(images_to_upload))
if len(duplicate_images):
logger.warning(
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
)

logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload)))

with tqdm(total=len(images_to_upload), desc="Attaching urls") as progress_bar:
for i in range(0, len(images_to_upload), 500):
Expand Down Expand Up @@ -2408,7 +2413,12 @@ def attach_video_urls_to_project(
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
list_of_uploaded = []

logger.info("Attaching %s images to project.", len(images_to_upload))
if len(duplicate_images):
logger.warning(
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
)

logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload)))

with tqdm(total=len(images_to_upload), desc="Attaching urls") as progress_bar:
for i in range(0, len(images_to_upload), 500):
Expand Down Expand Up @@ -3636,7 +3646,12 @@ def attach_document_urls_to_project(
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
list_of_uploaded = []

logger.info("Attaching %s images to project.", len(images_to_upload))
if len(duplicate_images):
logger.warning(
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
)

logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload)))

with tqdm(total=len(images_to_upload), desc="Attaching urls") as progress_bar:
for i in range(0, len(images_to_upload), 500):
Expand Down
4 changes: 4 additions & 0 deletions src/superannotate/lib/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
MAX_IMAGE_SIZE = 100 * 1024 * 1024 # 100 MB limit
TOKEN_UUID = "token"

ALREADY_EXISTING_FILES_WARNING = (
"{} already existing file(s) found that won't be uploaded."
)
ATTACHING_FILES_MESSAGE = "Attaching {} file(s) to project."

DEPRECATED_VIDEO_PROJECTS_MESSAGE = (
"The function does not support projects containing videos attached with URLs"
Expand Down