abars / YoloKerasFaceDetection

Face Detection and Gender and Age Classification using Keras
MIT License
209 stars 81 forks source link

how can I get boxes when run yolov2_tiny-face.h5 #12

Open KienPM opened 4 years ago

KienPM commented 4 years ago

Hello, I'm a newbie I want to gets boxes from yolov2_tiny-face.h5. Here is my code

from keras.models import load_model
from PIL import Image, ImageDraw
import numpy as np

input_image = Image.open('test.jpg')
image = input_image.resize((416, 416))
image = np.array(image)
image = image / 255.
image = np.expand_dims(image, 0)

model = load_model('yolov2_tiny-face.h5')
model.summary()
outputs = model.predict(image)

I got outputs.shape = (1, 13, 13, 30), same as last layer's shape, seem not correct Could you help me please!

Javcm commented 3 years ago

Hey, could you solve this? I have the same issue.