SoftwareAG/nyoka

retinaNet pmml predict

zj463261929 opened this issue · 3 comments

  1. h5-> pmml:
    model = load_model('resnet50_coco_best_v2.1.0.h5', backbone_name='resnet101')

backbone = 'resnet'
RetinanetToPmml(
model,
input_shape=(224,224,3),
backbone_name=backbone,
pmml_file_name="retinanet_with_coco_1.pmml",
model_name="RetinaNet model",
description="A Retinanet model with resnet as backbone"
)
2. pmml predict:
from pypmml import Model
import cv2
import pandas as pd

model = Model.load('retinanet_with_coco_1.pmml')
img = cv2.imread("20190506053526137.jpg", 0)
data = pd.DataFrame(img)
result = model.predict(data)
print (result.shape)

why result shape = (0, 0)??? or The prediction method is wrong???

Hi @zj463261929, I am not sure how pypmml works. They will be able to explain it better. Again, do they support the DeepNetwork element as this is not part of the official schema yet?

thank you, Can you tell me how I should predict my model, e.g "retinanet_with_coco_1.pmml"
input: image data、class name
output: bbox、score、class information

Talking about the PMML, it takes an image as input. The resource "KerasRetinaNet.jar" contains the utility functions for pre-processing and converting the image into required format (base64 string in this case). I hope it answers your question.