Skip to content

Commit

Permalink
do check for corrupt images only once
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswittich committed Feb 2, 2024
1 parent 6aa1edb commit d95c36b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ __pycache__/

.env
learning_loop_node/tmp
learning_loop_node/.python-version
1 change: 0 additions & 1 deletion learning_loop_node/data_exchanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ async def download_images(self, image_ids: List[str], image_folder: str) -> None
logging.warning('context was not set yet')
return

await self.delete_corrupt_images(image_folder)
new_image_ids = await asyncio.get_event_loop().run_in_executor(None, DataExchanger.filter_existing_images, image_ids, image_folder)
paths, ids = create_resource_paths(self.context.organization, self.context.project, new_image_ids)
await self._download_images(paths, ids, image_folder)
Expand Down
2 changes: 2 additions & 0 deletions learning_loop_node/trainer/trainer_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ async def _do_detections(self) -> None:
image_ids += new_ids
logging.info(f'downloading {len(new_ids)} images')
await self.node.data_exchanger.download_images(new_ids, image_folder)
self.detection_progress = 0.42
await self.node.data_exchanger.delete_corrupt_images(image_folder)

images = await asyncio.get_event_loop().run_in_executor(None, TrainerLogic.images_for_ids, image_ids, image_folder)
num_images = len(images)
Expand Down

0 comments on commit d95c36b

Please sign in to comment.