-
Notifications
You must be signed in to change notification settings - Fork 137
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
Add openvino interpreter samples #159
Add openvino interpreter samples #159
Conversation
I suggest moving |
…openvino_launcher.py into openvino/launcher.py.
I updated the requested changes. Can you review it again? |
We've discussed the problem with importing openvino launcher after these changes, but I don't see any changes here regarding this. Have you tested the patch? |
Yes. I tested. It works well. The reason previously openvino was not found, was because I had used python datum.py in repo instead of datum installed(v0.1.6.1) |
datumaro/plugins/openvino/README.md
Outdated
- vehicle-detection-0202 (https://docs.openvinotoolkit.org/latest/omz_models_intel_vehicle_detection_0202_description_vehicle_detection_0202.html) | ||
|
||
- Public Pre-Trained Models(OMZ) | ||
- Classification |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, it would be great, if you gave a notion about classes of supported models, instead of specific models. This would also cover custom, manually-converted models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give an example? The model link contains model input/output info. Do you want to change,
before
- Classification
to
- Classification
- mobilenet-v2-pytorch: imagenet 1000 classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I'm speaking about a line "or any other model with the last layer of type DetectionOutput" or any other similar kind of advice for searching other classes of models, which can be supported, but not tested (including custom user models). Or any instruction on how to get a (potentially, custom) model to work.
datumaro/plugins/openvino/README.md
Outdated
|
||
## Model inference | ||
- Prerequisites: | ||
- Put the models downloaded in <datumaro_root_dir>/datumaro/plugins/openvino/models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach doesn't look right. Do your examples only work with manually downloaded Datumaro repository? For a typical user, <datumaro_root_dir>
is somewhere in the python libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only the part that performs inference under the premise that the Datumaro repo is received. Do yo want to insert Datumaro ?
datumaro/plugins/openvino/samples/mobilenet_v2_pytorch_interp.py
Outdated
Show resolved
Hide resolved
datumaro/plugins/openvino/samples/ssd_person_vehicle_bike_detection_interp.py
Outdated
Show resolved
Hide resolved
datumaro/plugins/openvino/samples/ssd_person_vehicle_bike_detection_interp.py
Outdated
Show resolved
Hide resolved
Add a link to the plugin docs in the user manual. |
I uploaded PR again based on your comments. Please review it. |
datumaro/plugins/openvino/README.md
Outdated
- OpenVINO models (To download OpenVINO models, please go https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html) | ||
- VOCdevkit dataset (To download VOC2012 dataset, please go http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit) | ||
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) | ||
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction] https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing )
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction] https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html) | |
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction] https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
- VOCdevkit dataset (To download VOC2012 dataset, please go http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit) | ||
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) | ||
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction] https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html) | ||
- PASCAL VOC 2012 dataset (To download VOC 2012 dataset, please go [VOC2012 download](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing )
- PASCAL VOC 2012 dataset (To download VOC 2012 dataset, please go [VOC2012 download](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit) | |
- PASCAL VOC 2012 dataset (To download VOC 2012 dataset, please go [VOC2012 download](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
@@ -43,30 +50,31 @@ Interpreter samples to parse OpenVINO inference outputs. | |||
|
|||
## Model inference | |||
- Prerequisites: | |||
- Put the models downloaded in <datumaro_root_dir>/datumaro/plugins/openvino/models | |||
- Put the VOCdevkit dataset downloaded in <datumaro_root_dir> | |||
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ) (+3 next)
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) | |
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
# datum create -o <proj_dir> | ||
# datum model add -l <launcher> -p <proj_dir> --copy -- -d <path_to_xml> -w <path_to_bin> -i <path_to_interpreter_script> | ||
# datum add path -p <proj_dir> -f <format> <path_to_dataset> | ||
# datum model run -p <proj_dir> -m model-0 | ||
# | ||
# Examples | ||
# Detection> ssd_mobilenet_v2_coco | ||
. /opt/intel/openvino_2021/bin/setupvars.sh | ||
/opt/intel/openvino_2021/bin/setupvars.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
or source
in the beginning is required
/opt/intel/openvino_2021/bin/setupvars.sh | |
. /opt/intel/openvino/bin/setupvars.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we install openvino 2021.r1, the default path is /opt/intel/openvino_2021, not /opt/intel/openvino. The default path like openvino_2021 had been using since openvino 2021.r1. Do you still want me to change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to openvino because we don't know user which Openvino version will install. openvino is more general. So I changed it.
w = min(int(det[5] * input_width - x), input_width) | ||
h = min(int(det[6] * input_height - y), input_height) | ||
|
||
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) | |
image_results.append(Bbox(x, y, w, h, label=label, | |
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) } | |
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
w = min(int(det[5] * input_width - x), input_width) | ||
h = min(int(det[6] * input_height - y), input_height) | ||
|
||
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) | |
image_results.append(Bbox(x, y, w, h, label=label, | |
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) } | |
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
w = min(int(det[5] * input_width - x), input_width) | ||
h = min(int(det[6] * input_height - y), input_height) | ||
|
||
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) | |
image_results.append(Bbox(x, y, w, h, label=label, | |
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) } | |
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
w = min(int(det[5] * input_width - x), input_width) | ||
h = min(int(det[6] * input_height - y), input_height) | ||
|
||
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) | |
image_results.append(Bbox(x, y, w, h, label=label, | |
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) } | |
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
w = min(int(det[5] * input_width - x), input_width) | ||
h = min(int(det[6] * input_height - y), input_height) | ||
|
||
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_results.append(Bbox(x, y, w, h, label=label, attributes={"score": conf, "scores": list(map(float, det_confs)),},)) | |
image_results.append(Bbox(x, y, w, h, label=label, | |
attributes={ 'score': conf, 'scores': list(map(float, det_confs)) } | |
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
# Examples | ||
# Detection> ssd_mobilenet_v2_coco | ||
/opt/intel/openvino_2021/bin/setupvars.sh | ||
cd /home/cvalgo/workspace/datumaro/datumaro/plugins/openvino/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd /home/cvalgo/workspace/datumaro/datumaro/plugins/openvino/ | |
cd datumaro/plugins/openvino/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
datum create -o proj_ssd_mobilenet_v2_coco_detection | ||
datum model add -l openvino -p proj_ssd_mobilenet_v2_coco_detection --copy -- --output-layers=do_ExpandDims_conf/sigmoid -d model/ssd_mobilenet_v2_coco.xml -w model/ssd_mobilenet_v2_coco.bin -i samples/ssd_mobilenet_coco_detection_interp.py | ||
datum add path -p proj_ssd_mobilenet_v2_coco_detection -f voc /home/cvalgo/workspace/datumaro/VOCdevkit | ||
datum model run -p proj_ssd_mobilenet_v2_coco_detection -m model-0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datum create -o proj_ssd_mobilenet_v2_coco_detection | |
datum model add -l openvino -p proj_ssd_mobilenet_v2_coco_detection --copy -- --output-layers=do_ExpandDims_conf/sigmoid -d model/ssd_mobilenet_v2_coco.xml -w model/ssd_mobilenet_v2_coco.bin -i samples/ssd_mobilenet_coco_detection_interp.py | |
datum add path -p proj_ssd_mobilenet_v2_coco_detection -f voc /home/cvalgo/workspace/datumaro/VOCdevkit | |
datum model run -p proj_ssd_mobilenet_v2_coco_detection -m model-0 | |
datum create -o proj_ssd_mobilenet_v2_coco_detection | |
datum model add -l openvino -p proj_ssd_mobilenet_v2_coco_detection --copy -- \ | |
--output-layers=do_ExpandDims_conf/sigmoid \ | |
-d model/ssd_mobilenet_v2_coco.xml \ | |
-w model/ssd_mobilenet_v2_coco.bin \ | |
-i samples/ssd_mobilenet_coco_detection_interp.py | |
datum add path -p proj_ssd_mobilenet_v2_coco_detection -f voc VOCdevkit/ | |
datum model run -p proj_ssd_mobilenet_v2_coco_detection -m model-0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) | ||
- Datumaro (To install Datumaro, please see the [User Manual](docs/user_manual.md) | ||
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction] https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html) | ||
- PASCAL VOC 2012 dataset (To download VOC 2012 dataset, please go [VOC2012 download](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- PASCAL VOC 2012 dataset (To download VOC 2012 dataset, please go [VOC2012 download](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit) | |
- PASCAL VOC 2012 dataset (To download VOC 2012 dataset, please go [VOC2012 download](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
- Prerequisites: | ||
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) | ||
- Datumaro (To install Datumaro, please see the [User Manual](docs/user_manual.md) | ||
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction] https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction] https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html) | |
- OpenVINO™ models (To download OpenVINO™ models, please see the [Model Downloader Instruction] (https://docs.openvinotoolkit.org/latest/omz_tools_downloader_README.html)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
## Model inference | ||
- Prerequisites: | ||
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) | ||
- Datumaro (To install Datumaro, please see the [User Manual](docs/user_manual.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Datumaro (To install Datumaro, please see the [User Manual](docs/user_manual.md) | |
- Datumaro (To install Datumaro, please see the [User Manual](docs/user_manual.md)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
|
||
## Model download | ||
- Prerequisites | ||
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html) | |
- OpenVINO™ (To install OpenVINO™, please see the [OpenVINO™ Installation Instruction](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
Interpreter samples to parse OpenVINO™ inference outputs. | ||
|
||
## Models supported from interpreter samples | ||
There are 5 SSD and 1 image classification interpreter samples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 5 SSD and 1 image classification interpreter samples. | |
There are detection and image classification examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
datumaro/plugins/openvino/README.md
Outdated
## Models supported from interpreter samples | ||
There are 5 SSD and 1 image classification interpreter samples. | ||
|
||
- 5 SSD interpreter samples support the following models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 5 SSD interpreter samples support the following models. | |
- Detection (SSD-based) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
I uploaded PR again based on your comments. Can you review it? |
Summary
This PR includes ,
How to test
Checklist
develop
branchLicense
Feel free to contact the maintainers if that's a concern.