|
11 | 11 | from pathlib import Path |
12 | 12 | from typing import Any |
13 | 13 | from typing import Optional |
14 | | -from tqdm import tqdm |
15 | 14 |
|
16 | 15 | import lib.core as constances |
17 | 16 | import pandas as pd |
@@ -92,7 +91,7 @@ def upload_images( |
92 | 91 | project: str, |
93 | 92 | folder: str, |
94 | 93 | extensions: str = constances.DEFAULT_IMAGE_EXTENSIONS, |
95 | | - set_annotation_status: str = constances.AnnotationStatus.NOT_STARTED.value, |
| 94 | + set_annotation_status: str = constances.AnnotationStatus.NOT_STARTED.name, |
96 | 95 | exclude_file_patterns=constances.DEFAULT_FILE_EXCLUDE_PATTERNS, |
97 | 96 | recursive_subfolders=False, |
98 | 97 | image_quality_in_editor=None, |
@@ -130,7 +129,11 @@ def upload_image(image_path: str): |
130 | 129 | return ProcessedImage(uploaded=False, path=image_path, entity=None) |
131 | 130 |
|
132 | 131 | paths = [] |
133 | | - for extension in extensions.strip().split(","): |
| 132 | + |
| 133 | + if isinstance(extensions,str): |
| 134 | + extensions = extensions.strip().split(",") |
| 135 | + |
| 136 | + for extension in extensions: |
134 | 137 | if recursive_subfolders: |
135 | 138 | paths += list(Path(folder).rglob(f"*.{extension.lower()}")) |
136 | 139 | if os.name != "nt": |
@@ -165,7 +168,7 @@ def upload_image(image_path: str): |
165 | 168 | uploaded_image_entities.append(processed_image.entity) |
166 | 169 | else: |
167 | 170 | failed_images.append(processed_image.path) |
168 | | - progress_bar.update(1) |
| 171 | + progress_bar.update(1) |
169 | 172 |
|
170 | 173 | for i in range(0, len(uploaded_image_entities), 500): |
171 | 174 | self.controller.upload_images( |
|
0 commit comments