Skip to content

Commit

Permalink
bug: fix deletion in case of video process that includes video sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
jernejaMislej committed Aug 23, 2018
1 parent cef4dd5 commit cfeff38
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion mapillary_tools/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
process_and_upload
]

VERSION = "0.1.4"
VERSION = "0.1.5"


def add_general_arguments(parser, command):
Expand Down
2 changes: 1 addition & 1 deletion mapillary_tools/process_import_meta_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions mapillary_tools/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit cfeff38

Please sign in to comment.