-
Notifications
You must be signed in to change notification settings - Fork 59
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
RuntimeWarning: overflow encountered in scalar multiply #31
Comments
Could you give a bit more information to reproduce this? E.g. your python/pytorch/numpy versions and operating system. Also, please provide the exact script you ran to reproduce this. |
Hello @hukkelas i am having the same issue on my new macOS Sonoma, using the RetinaNet detectors. Using the DSFDetector it works fine, but i need the RetinaNet for the speed. It worked fine the last time i used it, on my windows in may. Back then i installed via pip install face_detection, but this time i was getting the 410 gone error so i changed to install via the github installation Python 3.12.7 Here is the code i am using:
|
It was working fine for me back in May when i first installed it on my last computer. I tried downloading your github and running test.py, changing the detector to RetinaNet and a similar error occured with "negative dimensions not allowed" |
@hukkelas i discovered that resizing the video frame to 25% its size the script runs fine, but i need to use the full resolution for the best results (1920 * 1080) Heres the full error with a print on the generate_prio_box
|
Opened a pull request to fix this issue, it was caused by an int overflow in large sized images |
img shape (1800, 2880, 3)
n_anchors += x[0] * x[1] * len(min_sizes[0])
Traceback (most recent call last):
File "test.py", line 29, in face_detect
boxes = detector.detect(img)
File "/lib/python3.8/site-packages/face_detection/base.py", line 56, in detect
boxes = self.batched_detect(image, shrink)
File "/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/lib/python3.8/site-packages/face_detection/base.py", line 146, in batched_detect
boxes = self._batched_detect(image)
File "/lib/python3.8/site-packages/face_detection/base.py", line 126, in _batched_detect
boxes = self._detect(image)
File "/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/lib/python3.8/site-packages/face_detection/retinaface/detect.py", line 120, in _detect
priors = priorbox.forward()
File "/lib/python3.8/site-packages/face_detection/retinaface/prior_box.py", line 43, in forward
anchors = generate_prior_box(
File "/lib/python3.8/site-packages/face_detection/retinaface/prior_box.py", line 26, in generate_prior_box
anchors[idx_anchor:idx_anchor+4] = [cx, cy, s_kx, s_ky]
ValueError: could not broadcast input array from shape (4,) into shape (0,)
The text was updated successfully, but these errors were encountered: