Skip to content

Commit 5d41afc

Browse files
committed
feat: print debug
1 parent 2a02bd3 commit 5d41afc

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="CVAT wrapper",
8-
version="0.0.11",
8+
version="0.0.12",
99
author="antwxne",
1010
author_email="[email protected]",
1111
description="Python wrapper for CVAT API",

src/CVAT/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/python3
22
# Created by [email protected] at 5/23/22
33
import re
4+
import sys
45
from os import walk
56
from typing import Optional
67

@@ -68,10 +69,12 @@ def image_content_from_kili_prediction(prediction: list[dict], directory: str) -
6869
paths: list[str] = []
6970
current_files: list[str] = get_files_from_path(directory)
7071
files_without_extension: list[str] = [file.split(".")[0] for file in current_files]
72+
print(f'all files {files_without_extension}', file=sys.stderr)
7173
for elem in tqdm(prediction, unit="Image"):
7274
path: str = f'{directory}/{elem["externalId"]}'
7375
if path not in files_without_extension:
7476
paths.append(CVAT.download_image(elem["content"], path))
77+
print(f"download {path}...", file=sys.stderr)
7578
else:
7679
paths.append(current_files[files_without_extension.index(path)])
7780
return paths

src/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
# API.upload_predictions(task, prediction)
1515

1616
if __name__ == "__main__":
17-
API.create_user("oui", "[email protected]", "kgjhagkjlhlaegkj", "aaa", "aaaa")
18-
# prediction_json: list[dict] = CVAT.get_json_from_file("./foodvisor_valid_12_2021_Fromages_gmd_predictions.json")
19-
# directory: str = "data/Images/Fromages"
17+
# API.create_user("oui", "[email protected]", "kgjhagkjlhlaegkj", "aaa", "aaaa")
18+
prediction_json: list[dict] = CVAT.get_json_from_file("./foodvisor_valid_12_2021_Fromages_gmd_predictions.json")
19+
directory: str = "data/Images/Fromages"
2020
# interface: dict = CVAT.get_json_from_file("../interface_foodvisor.json")
21-
# images_path: list[str] = image_content_from_kili_prediction(prediction_json, directory)
21+
images_path: list[str] = image_content_from_kili_prediction(prediction_json, directory)
2222
# project_id: int = API.create_project("TEST_API2", interface=interface)
2323
# task: Task = Task("jqefhgfdqf", project_id=project_id)
2424
# task: Task = API.get_task_by_name("qsfqsfqsf")

0 commit comments

Comments
 (0)