Skip to content

Commit b1bf2c1

Browse files
committed
Fix duplicate image upload on Windows
1 parent 7c0c071 commit b1bf2c1

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ for COCO annotation format converters support also need to install:
5151

5252
.. code-block:: bash
5353
54-
pip install 'git+https://github.com/cocodataset/panopticapi.git'
55-
pip install 'git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI'
54+
pip install "git+https://github.com/cocodataset/panopticapi.git"
55+
pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
5656
5757
The package officially supports Python 3.6+ and was tested under Linux platform.
5858
For Windows based Anaconda distribution

docs/source/tutorial.sdk.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,21 @@ for COCO annotation format converters support also need to install:
2121

2222
.. code-block:: bash
2323
24-
pip install 'git+https://github.com/cocodataset/panopticapi.git'
25-
pip install 'git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI'
24+
pip install "git+https://github.com/cocodataset/panopticapi.git"
25+
pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
2626
2727
The package officially supports Python 3.6+ and was tested under Linux platform.
28+
2829
For Windows based Anaconda distribution
2930
you might also need to install :py:obj:`shapely` package separately:
3031

3132
.. code-block:: bash
3233
3334
conda install shapely
3435
36+
and also need to install C++ build tools from `Microsoft Visual Studio Tools
37+
<https://visualstudio.microsoft.com/visual-cpp-build-tools/>`_.
38+
3539
----------
3640

3741
Config file

superannotate/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import numpy as np
21
import functools
32
import logging
43
from pathlib import Path
54

5+
import numpy as np
6+
67
from .exceptions import SABaseException
78

89
logger = logging.getLogger("superannotate-python-sdk")

superannotate/db/projects.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import logging
55
import math
6+
import os
67
import random
78
import threading
89
import tempfile
@@ -462,10 +463,12 @@ def upload_videos_from_folder_to_project(
462463
for extension in extensions:
463464
if not recursive_subfolders:
464465
paths += list(Path(folder_path).glob(f'*.{extension.lower()}'))
465-
paths += list(Path(folder_path).glob(f'*.{extension.upper()}'))
466+
if os.name != "nt":
467+
paths += list(Path(folder_path).glob(f'*.{extension.upper()}'))
466468
else:
467469
paths += list(Path(folder_path).rglob(f'*.{extension.lower()}'))
468-
paths += list(Path(folder_path).rglob(f'*.{extension.upper()}'))
470+
if os.name != "nt":
471+
paths += list(Path(folder_path).rglob(f'*.{extension.upper()}'))
469472
filtered_paths = []
470473
for path in paths:
471474
not_in_exclude_list = [
@@ -552,10 +555,16 @@ def upload_images_from_folder_to_project(
552555
for extension in extensions:
553556
if not recursive_subfolders:
554557
paths += list(Path(folder_path).glob(f'*.{extension.lower()}'))
555-
paths += list(Path(folder_path).glob(f'*.{extension.upper()}'))
558+
if os.name != "nt":
559+
paths += list(
560+
Path(folder_path).glob(f'*.{extension.upper()}')
561+
)
556562
else:
557563
paths += list(Path(folder_path).rglob(f'*.{extension.lower()}'))
558-
paths += list(Path(folder_path).rglob(f'*.{extension.upper()}'))
564+
if os.name != "nt":
565+
paths += list(
566+
Path(folder_path).rglob(f'*.{extension.upper()}')
567+
)
559568
else:
560569
s3_client = boto3.client('s3')
561570
paginator = s3_client.get_paginator('list_objects_v2')
@@ -571,8 +580,10 @@ def upload_images_from_folder_to_project(
571580
1:]:
572581
continue
573582
for extension in extensions:
574-
if key.endswith(f'.{extension.lower()}'
575-
) or key.endswith(f'.{extension.upper()}'):
583+
if key.endswith(f'.{extension.lower()}') or (
584+
os.name != "nt" and
585+
key.endswith(f'.{extension.upper()}')
586+
):
576587
paths.append(key)
577588
break
578589
filtered_paths = []

superannotate/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.3.12"
1+
__version__ = "2.3.13"

0 commit comments

Comments
 (0)