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

Traceback (most recent call last): File "mtcnn/data_preprocess/gen_Pnet_train_data.py", line 94, in <module> delta_x = np.random.randint(max(-size, -x1), w) File "mtrand.pyx", line 630, in numpy.random.mtrand.RandomState.randint File "bounded_integers.pyx", line 1228, in numpy.random.bounded_integers._rand_int64 ValueError: low >= high #13

Open
ouening opened this issue Dec 30, 2019 · 9 comments

Comments

@ouening
Copy link

ouening commented Dec 30, 2019

Hi, when I generate the Pnet train data, some errors happend:

12880 pics in total
/media/gaoya/disk/Applications/pytorch/目标检测/人脸检测/dataset/WIDER_FACE/WIDER_train/images/0--Parade/0_Parade_marchingband_1_849.jpg
/media/gaoya/disk/Applications/pytorch/目标检测/人脸检测/dataset/WIDER_FACE/WIDER_train/images/0--Parade/0_Parade_Parade_0_904.jpg
Traceback (most recent call last):
  File "mtcnn/data_preprocess/gen_Pnet_train_data.py", line 94, in <module>
    delta_x = np.random.randint(max(-size, -x1), w)
  File "mtrand.pyx", line 630, in numpy.random.mtrand.RandomState.randint
  File "bounded_integers.pyx", line 1228, in numpy.random.bounded_integers._rand_int64
ValueError: low >= high

How can I solve it?

@Z-Jeff
Copy link

Z-Jeff commented Jan 8, 2020

There is a bug in "mtcnn/data_preprocess/gen_Pnet_train_data.py".
'boxes' should be the form of [x1, y1, x2, y2], while the data in "./anno_store/anno_train.txt" is [x1, x2, dx, dy].

So, correct the form of 'boxes' can solve the problem.
Here is my solution:

for box in boxes:
        box[2] = box[0] + box[2]
        box[3] = box[1] + box[3]

Add these lines between line 48 and 49.
Then the error disappears.

@Z-Jeff
Copy link

Z-Jeff commented Jan 17, 2020

What's more, there is a same question in "gen_Rnet_train_data.py" and "gen_Onet_train_data.py".
Deal it in the same way.

@ysf465639310
Copy link

ysf465639310 commented May 20, 2020

In .mat file of wilder_face , Number of bounding box:
x1, y1, w, h, blur, expression, illumination, invalid, occlusion, pose

not x1 y1 x2 y2 so you should fix it

like:

for box in boxes:
    # box (x_left, y_top, x_right, y_bottom)
    x1, y1, w, h = box
    # w = x2 - x1 + 1
    # h = y2 - y1 + 1
    x2 = x1 + w - 1
    y2 = y1 + h - 1

@SURABHI-GUPTA
Copy link

@Z-Jeff why are we not generating landmark data for pnet and rnet ?

@LiYunJamesPhD
Copy link

When I ran mtcnn/data_preprocess/gen_Pnet_train_data.py, I received an error from this implementation. How did I resolve this issue? Thanks.

Traceback (most recent call last):
File "mtcnn/data_preprocess/gen_Pnet_train_data.py", line 162, in
delta_x = np.random.randint(-w * 0.2, w * 0.2)
File "mtrand.pyx", line 743, in numpy.random.mtrand.RandomState.randint
File "_bounded_integers.pyx", line 1260, in numpy.random._bounded_integers._rand_int64
ValueError: low >= high

@DantesDawn
Copy link

@LiYunJamesPhD ,I also encountered the same problem. Have you solved it?

@LiYunJamesPhD
Copy link

@DantesDawn Hi, no, I could not solve this issue.

@DantesDawn
Copy link

@LiYunJamesPhD , Thank you for your reply. I have solved this problem. The simplest method is to delete the error data 5-29. Another method is that I see that the warehouse provides the annotation file conversion tool code for x, y, w, h and x1, y1, x2, y2. I think I can try. Well, the third method should be to modify the error code, but I haven't read the code in detail.

@LiYunJamesPhD
Copy link

@DantesDawn Sounds great! I have not touched this code for a while because I was done with my internship (this code is part of my internship works). It is still good to know the solutions for that issue. Thanks.

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

No branches or pull requests

6 participants