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

Eval resized image #6

Open
tsly123 opened this issue Apr 12, 2018 · 0 comments
Open

Eval resized image #6

tsly123 opened this issue Apr 12, 2018 · 0 comments

Comments

@tsly123
Copy link

tsly123 commented Apr 12, 2018

Hi @cydonia999,

First, thank you for your work.
I try to detect the face with resized image (512x512x3). I added the cv2.resize function to your code but the result was not as expected. The bbx does not cover exactly the face as shown in followed images, original resolution and resized respectively.

#  line  105 - 117 in  tiny_face_eval.py

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())

    for filename in filenames:
      fname = filename.split(os.sep)[-1]
      raw_img = cv2.imread(filename)
      raw_img = cv2.cvtColor(raw_img, cv2.COLOR_BGR2RGB)
      raw_img = cv2.resize(raw_img, (img_width, img_height))     <<<<<<<<   RESIZE IMAGE (512x512x3)
      raw_img_f = raw_img.astype(np.float32)

      def _calc_scales():
        raw_h, raw_w = raw_img.shape[0], raw_img.shape[1]
        min_scale = min(np.floor(np.log2(np.max(clusters_w[normal_idx] / raw_w))),
                        np.floor(np.log2(np.max(clusters_h[normal_idx] / raw_h))))

Do you have any suggest to how can I get the the result as original resolution image?
Thank you.

0000000005
0000000005
0000000045
0000000045

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

1 participant