sthanhng / yoloface

Deep learning-based Face detection using the YOLOv3 algorithm (https://github.com/sthanhng/yoloface)
MIT License
454 stars 180 forks source link

Batch Evaluation #38

Open joeyism opened 3 years ago

joeyism commented 3 years ago

Hi,

Thank you for the model and the code. I noticed that your code evaluates each image one by one, and I was wondering how would you modify the code so it works in batches? I tried inputting the images in batches but it only seem to ever return the results from the first image.

For example, taking code from https://github.com/sthanhng/yoloface/blob/master/yolo/yolo.py#L114, I'd run

out_boxes, out_scores, out_classes = self.sess.run(
    [self.boxes, self.scores, self.classes],
    feed_dict={
        self.yolo_model.input: image_data,
        self.input_image_shape: [image.size[1], image.size[0]],
        K.learning_phase(): 0
    })

where image_data has shape (2, 416, 416, 3), but the return out_boxes is (1, 4) even if both images in image_data are the exact same.

Thanks