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

Empty prior bboxes in 227_face-detection-adas-0001 #306

Closed
PCTsai opened this issue Nov 1, 2022 · 3 comments
Closed

Empty prior bboxes in 227_face-detection-adas-0001 #306

PCTsai opened this issue Nov 1, 2022 · 3 comments

Comments

@PCTsai
Copy link

PCTsai commented Nov 1, 2022

Issue Type

Support

OS

Ubuntu

OS architecture

x86_64

Programming Language

Python

Framework

TensorFlowLite

Model name and Weights/Checkpoints URL

https://github.com/PINTO0309/PINTO_model_zoo/tree/main/227_face-detection-adas-0001

Description

Hi PINTO, I'm trying to run the face detection model followed by the issue response and the sample code. The output bboxes seem ok but the corresponding prior bboxes is always zero (i.e. [0,0,0,0]) which causes zero decoded bbox for the final result. I had checked the prior bboxes loaded from 0.npy where totally number is 10112 and found 10105 zero bboxes. Is this prior bboxes file 0.npy correct for this model?

Relevant Log Output

No response

URL or source code for simple inference testing code

No response

@PINTO0309
Copy link
Owner

https://github.com/PINTO0309/PINTO_model_zoo/tree/main/227_face-detection-adas-0001

>>> import numpy as np
>>> np.load('0.npy')
array([[[0.9796773, 0.9497039, 0.9965132, ..., 0.       , 0.       ,
         0.       ],
        [0.1      , 0.1      , 0.2      , ..., 0.1      , 0.2      ,
         0.2      ]]], dtype=float32)
>>> np.load('0.npy').shape
(1, 2, 40448)
>>> 

@PCTsai
Copy link
Author

PCTsai commented Nov 2, 2022

Yes, the data dimension in the file 0.npy is (1, 2, 40448). As I know is that it consists of 10112 prior bboxes and 10112 corresponding prior variances (always [0.1, 0.1, 0.2, 0.2]). After squeezing and reshaping the loaded data as shown in the below code, it is clear to see that data in prior bboxes is almost empty (10105 zero prior bboxes), that means the decoded bboxes will be also empty and face detection will fail. However, 0.npy in 179_person-detection-0202 is not empty and works well.

>>> import numpy as np
>>> np.load("0.npy")
array([[[0.9796773, 0.9497039, 0.9965132, ..., 0.       , 0.       ,
         0.       ],
        [0.1      , 0.1      , 0.2      , ..., 0.1      , 0.2      ,
         0.2      ]]], dtype=float32)
>>> np.load("0.npy").shape
(1, 2, 40448)
>>> prior_bbox_data = np.squeeze(np.load("0.npy"))
>>> prior_bbox_data
array([[0.9796773, 0.9497039, 0.9965132, ..., 0.       , 0.       ,
        0.       ],
       [0.1      , 0.1      , 0.2      , ..., 0.1      , 0.2      ,
        0.2      ]], dtype=float32)
>>> prior_bbox_data.shape
(2, 40448)
>>> prior_bbox_data_reshape = np.reshape(prior_bbox_data, (2, -1, 4))
>>> prior_bbox_data_reshape
array([[[0.9796773, 0.9497039, 0.9965132, 1.0086294],
        [0.       , 0.       , 0.       , 0.       ],
        [0.       , 0.       , 0.       , 0.       ],
        ...,
        [0.       , 0.       , 0.       , 0.       ],
        [0.       , 0.       , 0.       , 0.       ],
        [0.       , 0.       , 0.       , 0.       ]],

       [[0.1      , 0.1      , 0.2      , 0.2      ],
        [0.1      , 0.1      , 0.2      , 0.2      ],
        [0.1      , 0.1      , 0.2      , 0.2      ],
        ...,
        [0.1      , 0.1      , 0.2      , 0.2      ],
        [0.1      , 0.1      , 0.2      , 0.2      ],
        [0.1      , 0.1      , 0.2      , 0.2      ]]], dtype=float32)
>>> prior_bbox_data_reshape.shape
(2, 10112, 4)
>>> prior_bbox = prior_bbox_data_reshape[0]
>>> prior_bbox
array([[0.9796773, 0.9497039, 0.9965132, 1.0086294],
       [0.       , 0.       , 0.       , 0.       ],
       [0.       , 0.       , 0.       , 0.       ],
       ...,
       [0.       , 0.       , 0.       , 0.       ],
       [0.       , 0.       , 0.       , 0.       ],
       [0.       , 0.       , 0.       , 0.       ]], dtype=float32)
>>> prior_varience = prior_bbox_data_reshape[1]
>>> prior_varience
array([[0.1, 0.1, 0.2, 0.2],
       [0.1, 0.1, 0.2, 0.2],
       [0.1, 0.1, 0.2, 0.2],
       ...,
       [0.1, 0.1, 0.2, 0.2],
       [0.1, 0.1, 0.2, 0.2],
       [0.1, 0.1, 0.2, 0.2]], dtype=float32)
>>> 

@PINTO0309
Copy link
Owner

The model is too old to retrieve the original file.

I recommend the use of the following
https://github.com/PINTO0309/PINTO_model_zoo/tree/main/383_DirectMHP

243224044-8d7282b2-c204-4076-8c5d-6b2ced3f2776.mp4

https://github.com/PINTO0309/PINTO_model_zoo/tree/main/407_Generalizing_Gaze_Estimation

264629960-4744467a-c213-4068-ad29-9075f059bb1f.mp4

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

2 participants