Skip to content

Commit

Permalink
feat: print debug
Browse files Browse the repository at this point in the history
  • Loading branch information
antwxne committed Jun 10, 2022
1 parent 2a02bd3 commit 5d41afc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="CVAT wrapper",
version="0.0.11",
version="0.0.12",
author="antwxne",
author_email="[email protected]",
description="Python wrapper for CVAT API",
Expand Down
3 changes: 3 additions & 0 deletions src/CVAT/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/python3
# Created by [email protected] at 5/23/22
import re
import sys
from os import walk
from typing import Optional

Expand Down Expand Up @@ -68,10 +69,12 @@ def image_content_from_kili_prediction(prediction: list[dict], directory: str) -
paths: list[str] = []
current_files: list[str] = get_files_from_path(directory)
files_without_extension: list[str] = [file.split(".")[0] for file in current_files]
print(f'all files {files_without_extension}', file=sys.stderr)
for elem in tqdm(prediction, unit="Image"):
path: str = f'{directory}/{elem["externalId"]}'
if path not in files_without_extension:
paths.append(CVAT.download_image(elem["content"], path))
print(f"download {path}...", file=sys.stderr)
else:
paths.append(current_files[files_without_extension.index(path)])
return paths
8 changes: 4 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# API.upload_predictions(task, prediction)

if __name__ == "__main__":
API.create_user("oui", "[email protected]", "kgjhagkjlhlaegkj", "aaa", "aaaa")
# prediction_json: list[dict] = CVAT.get_json_from_file("./foodvisor_valid_12_2021_Fromages_gmd_predictions.json")
# directory: str = "data/Images/Fromages"
# API.create_user("oui", "[email protected]", "kgjhagkjlhlaegkj", "aaa", "aaaa")
prediction_json: list[dict] = CVAT.get_json_from_file("./foodvisor_valid_12_2021_Fromages_gmd_predictions.json")
directory: str = "data/Images/Fromages"
# interface: dict = CVAT.get_json_from_file("../interface_foodvisor.json")
# images_path: list[str] = image_content_from_kili_prediction(prediction_json, directory)
images_path: list[str] = image_content_from_kili_prediction(prediction_json, directory)
# project_id: int = API.create_project("TEST_API2", interface=interface)
# task: Task = Task("jqefhgfdqf", project_id=project_id)
# task: Task = API.get_task_by_name("qsfqsfqsf")
Expand Down

0 comments on commit 5d41afc

Please sign in to comment.