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

detect_face bug-fix for list of torch tensors #225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgp123
Copy link

@mgp123 mgp123 commented Apr 28, 2024

bug-fix.sizeinstead of size().
size is the method. size() is the correct equivalent to shape

@mgp123
Copy link
Author

mgp123 commented Apr 28, 2024

Note that this would break detect_face for PIL.Image lists so this is a partial patch to be able to play with torch tensors. Needs more tweaks in order for this to work for all cases

@nighting0le01
Copy link

is that the only change required to make it work for batch of torch.tensors? did you face any other issues like mismatch in mask shape

@mgp123
Copy link
Author

mgp123 commented Jun 26, 2024

Sorry. It was a while ago. I can't quite remember how I managed to do it.

@@ -35,7 +35,7 @@ def detect_face(imgs, minsize, pnet, rnet, onet, threshold, factor, device):
else:
if not isinstance(imgs, (list, tuple)):
imgs = [imgs]
if any(img.size != imgs[0].size for img in imgs):
if any(img.size() != imgs[0].size() for img in imgs):
Copy link
Owner

Choose a reason for hiding this comment

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

Does this change break the ability to pass in lists of PIL images?

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.

3 participants