Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle filename contains multiple "." #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ntvthuyen
Copy link

split_path = f.rsplit(".") only can't handle filenames that contain more than "." Ex: file.30.26.jpg
It will produce an opencv write error. (It will try to cv.imwrite("file.30",img ).
In this modification, I join all elements of split_path array from the start to (n - 1) th to create new split_path with just 2 elements.
Ex: file.30.26.jpg -> ["file","30","26","jpg"] -> ["file.30.26","jpg"]

split_path = f.rsplit(".") only can't handle filenames that contain more than "." Ex: file.30.26.jpg
It will produce an opencv write error. (It will try to cv.imwrite("file.30",img ).
In this modification, I join all elements of split_path array from the start to (n - 1) th to create new split_path with just 2 elements.
Ex: file.30.26.jpg -> ["file","30","26","jpg"] -> ["file.30.26","jpg"]
Copy link

@tintinmaster tintinmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same line split_path = [".".join(split_path[:-1]),split_path[-1]] is also needed in line 172

mask_the_face.py Outdated Show resolved Hide resolved
ntvthuyen and others added 2 commits November 9, 2022 19:47
Co-authored-by: Tim Schneider <tim.schneider1337@gmail.com>
Copy link
Author

@ntvthuyen ntvthuyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update line 172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants