Skip to content

Commit

Permalink
fix: load image from local
Browse files Browse the repository at this point in the history
  • Loading branch information
antwxne committed Jun 10, 2022
1 parent 5d41afc commit 4855d9f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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.12",
version="0.0.13",
author="antwxne",
author_email="[email protected]",
description="Python wrapper for CVAT API",
Expand Down
8 changes: 7 additions & 1 deletion src/CVAT/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ 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]
files_without_extension: list[str] = [ ]
for file in current_files:
splitted:list[str] = file.split(".")
if splitted[0] != "":
files_without_extension.append(splitted[0])
else:
files_without_extension.append("." + splitted[1])
print(f'all files {files_without_extension}', file=sys.stderr)
for elem in tqdm(prediction, unit="Image"):
path: str = f'{directory}/{elem["externalId"]}'
Expand Down
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
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"
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)
# project_id: int = API.create_project("TEST_API2", interface=interface)
Expand Down

0 comments on commit 4855d9f

Please sign in to comment.