From cfeff384057927c3a980fb90945f1eca8766c58f Mon Sep 17 00:00:00 2001 From: jernejaMislej Date: Thu, 23 Aug 2018 13:12:50 +0200 Subject: [PATCH] bug: fix deletion in case of video process that includes video sampling --- CHANGELOG.MD | 4 ++++ mapillary_tools/commands/__init__.py | 2 +- mapillary_tools/process_import_meta_properties.py | 2 +- mapillary_tools/processing.py | 6 ++---- setup.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 4ce69a3e..e74a0adb 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -57,3 +57,7 @@ * Do not require filename column to be passed when processing csv, but align csv data and images in order by image file names if filename column is missing * Support partial matching between image file names and file names in the csv file +## 0.1.5 (2018-08-23) + +### Bug fixes +* Do not delete the import path in case it is specified as an import path for video files to be sampled into and that particular video file was already sampled into that import path, but rather issue a warning that user needs to delete existing frames that were sampled in any previous runs diff --git a/mapillary_tools/commands/__init__.py b/mapillary_tools/commands/__init__.py index 663c41d1..cf2ff7d9 100644 --- a/mapillary_tools/commands/__init__.py +++ b/mapillary_tools/commands/__init__.py @@ -34,7 +34,7 @@ process_and_upload ] -VERSION = "0.1.4" +VERSION = "0.1.5" def add_general_arguments(parser, command): diff --git a/mapillary_tools/process_import_meta_properties.py b/mapillary_tools/process_import_meta_properties.py index ea1f52f1..ad5a4a2c 100644 --- a/mapillary_tools/process_import_meta_properties.py +++ b/mapillary_tools/process_import_meta_properties.py @@ -78,7 +78,7 @@ def finalize_import_properties_process(image, add_meta_tag(mapillary_description, "strings", "mapillary_tools_version", - "0.1.4") + "0.1.5") processing.create_and_log_process(image, "import_meta_data_process", diff --git a/mapillary_tools/processing.py b/mapillary_tools/processing.py index b2765b61..ca1237e7 100644 --- a/mapillary_tools/processing.py +++ b/mapillary_tools/processing.py @@ -570,14 +570,12 @@ def processed_images_rootpath(filepath): def video_upload(video_file, import_path, verbose=False): log_root = uploader.log_rootpath(video_file) import_paths = video_import_paths(video_file) - if os.path.isdir(import_path): - print("Warning, {} has already been sampled into {}, previously sampled frames will be deleted".format( - video_file, import_path)) - shutil.rmtree(import_path) if not os.path.isdir(import_path): os.makedirs(import_path) if import_path not in import_paths: import_paths.append(import_path) + else: + print("Warning, {} has already been sampled into {}, please make sure all the previously sampled frames are deleted, otherwise the alignment might be incorrect".format(video_file, import_path)) for video_import_path in import_paths: if os.path.isdir(video_import_path): if len(uploader.get_success_upload_file_list(video_import_path)): diff --git a/setup.py b/setup.py index 02a3d7ec..1e4d2bff 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup(name='mapillary_tools', - version='0.1.4', + version='0.1.5', description='Mapillary Image/Video Import Pipeline', url='https://github.com/mapillary/mapillary_tools', author='Mapillary',