Comments (3)
Sorry, my bad. It should have been face-detection-0204
import numpy as np
import openvino as ov
import cv2
core = ov.runtime.ie_api.Core()
detection_model_xml = r"C:/Users/vzlobin/.cache/omz/intel/face-detection-0204/FP16/face-detection-0204.xml"
detection_model = core.read_model(model=detection_model_xml)
detection_input_layer = detection_model.input(0)
new_shape = (-1, 3, 448, 448)
detection_model.reshape({detection_input_layer.any_name: new_shape})
detection_compiled_model = core.compile_model(model=detection_model, device_name="CPU")
# to run the model:
images = np.stack([
cv2.resize(cv2.imread(r"C:/Users/vzlobin/OneDrive - Intel Corporation/a/test-data/coco128/images/train2017/000000000036.jpg"), (new_shape[3], new_shape[2])),
cv2.resize(cv2.imread(r"C:/Users/vzlobin/OneDrive - Intel Corporation/a/test-data/coco128/images/train2017/000000000086.jpg"), (new_shape[3], new_shape[2]))
])
input_data = images.transpose(0, 3, 1, 2)
output = detection_compiled_model(input_data)
BLUE = (255, 0, 0)
for image_id, _, conf, x_min, y_min, x_max, y_max in output['detection_out'][0, 0]:
if image_id < 0:
break
if conf < 0.5:
continue
cv2.rectangle(images[int(image_id)], [round(x_min * new_shape[3]), round(y_min * new_shape[2])], [round(x_max * new_shape[3]), round(y_max * new_shape[2])], BLUE, 2)
cv2.imshow('winname', np.concatenate(images, 1))
cv2.waitKey(0)
from open_model_zoo.
Hi. Sorry, I missed this. Yes, face-detection-0206
isn't usable with batch. You can try other detectors, for example face-detection-0205
from open_model_zoo.
Hi. Sorry, I missed this. Yes,
face-detection-0206
isn't usable with batch. You can try other detectors, for example face-detection-0205
@Wovchena thanks for your reply, it's unfortunate that the model is not usable with batch. Looks like face-detection-0205 also has the same problem, output layer is still dynamic..
from open_model_zoo.
Related Issues (20)
- please help me HOT 3
- Error in running "multi_camera_multi_target_tracking_demo.py" HOT 1
- doc error: `device_support.md` table fails to layout -- get raw markdown instead HOT 3
- How to Train Open_ Model_ Zoom/models/intel /Road segmentation adas 0001/This model? HOT 2
- Failure to obtain correct results using official models and images
- all models xml file not load. HOT 4
- No information about OpenCV issues with odd resolution in documentation.
- head-pose-estimation-adas-0001 use in opecv dnn? HOT 1
- G-API Gaze Estimation demo lists `m_es` parameter as optional but fails to run when it is not set HOT 1
- [Feature Request]: Gaze Estimation Demos questions HOT 2
- Issue running sound classification demo HOT 9
- Benchmark data in Intel Xe Graphic and Arc Graphic for Single Image Super Resolution Model HOT 1
- unable to download MS-ASL-100 dataset HOT 1
- How to let OpenVino recoginze Intel Agilex® 7 Device HOT 11
- Converting model error with wav2vec2-base
- Linked to Pre Trained Weights Broken? HOT 1
- OpenVino development tools not getting installed, throwing , No module named 'distutils'. HOT 1
- omz_downloader command not found HOT 3
- Human Pose estimation-001 model input size mismatch HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open_model_zoo.