Skip to content

Commit

Permalink
clean dir before download, fix result teamfiles path
Browse files Browse the repository at this point in the history
  • Loading branch information
almazgimaev committed Aug 8, 2023
1 parent fd81448 commit 925da9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,16 @@ def _print_progress(monitor, upload_progress):

file_info = api.file.upload(TEAM_ID, result_archive, remote_archive_path,
lambda m: _print_progress(m, upload_progress))
app_logger.info("Uploaded to Team-Files: {!r}".format(file_info.storage_path))
app_logger.info("Uploaded to Team-Files: {!r}".format(file_info.path))
api.task.set_output_archive(task_id, file_info.id, full_archive_name, file_url=file_info.storage_path)
my_app.stop()


def download_json_plus_images(api, project, dataset_ids):
sly.logger.info('DOWNLOAD_PROJECT', extra={'title': project.name})
download_dir = os.path.join(my_app.data_dir, f'{project.id}_{project.name}')
if os.path.exists(download_dir):
sly.fs.clean_dir(download_dir)
sly.download_project(api, project.id, download_dir, dataset_ids=dataset_ids,
log_progress=True, batch_size=batch_size)
sly.logger.info('Project {!r} has been successfully downloaded.'.format(project.name))
Expand Down

0 comments on commit 925da9b

Please sign in to comment.