1

Since intel open vino does not directly support keras, I saved keras model in saved_model.pb by using this method https://docs.openvino.ai/latest/openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow.html (using open vino version 2021.4) After that, I converted it to IR (xml and bin) and tested with hello classification.py in development tool (it worked fine, result with 1 image = class id 0 = 100 percent , class id 1 = 0 percent).

Finally I want to use my classification model with one of open model in open vino (etc. person detection). I ran my code like below enter image description here

I got unsupported model output. I think I know why because my classification has label 0 (person wearing hat) and 1(not wearing hat). However, at the same time person-detection-0201 (https://docs.openvino.ai/2021.4/omz_models_model_person_detection_0201.html) has output id 0 = person. if my classifcation classifiy whether a person is wearing hat or not with this person detection, what should I do? I am lost on this. Do I have to make my own custom object detection.py (or modify from the original object detection.py ,same thing)

final output result (steps):

  1. I want to see the object detection demo detects a person first with person-detection-0201
  2. classify whether a person is wearing a hat or not from person-detection-0201
newbieLife
  • 39
  • 5

1 Answers1

0

The network of Object Detection Demo is only supported for one model in a single inference. To run an inference with multiple outputs, you should combine the image data and re-train the network. The result of the first model will be fed as an input of the second model for inference. The Security Barrier Camera C++ Demo and Action Recognition Python Demo are examples that use multiple models in a single inference.

Person-detection-0201 model network is only able to detect based on MobileNetV2 backbone with two SSD heads from 1/16 and 1/8 scale feature maps, and clustered prior boxes for 384x384 resolution. To classify a person wearing hat, it is only possible if you have the weight file and add person wearing hat dataset into the training set. This can be done with fine-tuning or using the pre-trained weight file.

Aznie_Intel
  • 101
  • 3
  • can you explain "This can be done with fine-tuning or using the pre-trained weight file." llittle bit more? Or do you have some good examples for this? – newbieLife Dec 21 '22 at 08:30
  • OpenVINO [Training Extensions](https://github.com/openvinotoolkit/training_extensions/blob/misc/README.md) provide a [training pipeline](https://github.com/openvinotoolkit/training_extensions/blob/misc/models/object_detection/model_templates/person-detection/readme.md) that allows fine-tuning the model on custom dataset. – Aznie_Intel Dec 22 '22 at 02:24