Comments (1)
@Wovchena I guess, this issue occurs due to mismatch between the expected input shape of the model and the actual input shape provided by the background_subtraction_demo_gapi
demo.
you may try these steps and do let me know if it works:-
- resize the video frame to the required dimensions before passing it to the model.
- snippet for preprocessing video frames and convert to required format of
[1, 3, height, width].
import cv2
import numpy as np
def preprocess_frame(frame, target_height, target_width):
# Resize the frame
resized_frame = cv2.resize(frame, (target_width, target_height))
# Convert the frame to the format [1, 3, height, width]
input_frame = np.expand_dims(resized_frame.transpose(2, 0, 1), axis=0)
return input_frame
# Open the video file
cap = cv2.VideoCapture('person-bicycle-car-detection.mp4')
# Read the first frame
ret, frame = cap.read()
if not ret:
print("Failed to read the video file")
exit()
# Preprocess the frame
input_frame = preprocess_frame(frame, 432, 768) # Replace with the target height and width
# Save the preprocessed frame as an example (optional)
np.save('preprocessed_frame.npy', input_frame)
# Release the video capture object
cap.release()
- update the demo script with the above change and execute it
plz let me know, if the above works or not
Thanks
from open_model_zoo.
Related Issues (20)
- 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
- Use batch size larger than 1 in models with dynamic output HOT 3
- OpenVino development tools not getting installed, throwing , No module named 'distutils'. HOT 2
- omz_downloader command not found HOT 3
- Human Pose estimation-001 model input size mismatch HOT 5
- GT File Generation For Multi-Camera Multi-Target Tracking HOT 1
- ModuleNotFoundError: No module named 'openvino.model_zoo' HOT 3
- background_subtraction_demo cpp cannot build HOT 2
- Documentation for the gaze estimation model HOT 2
- Failed to build omz-tools HOT 1
- Can't import 'model_zoo' package after PR 3907
- Can't run object_detection_demo.py with GPU or CPU. HOT 1
- Modernize Python Model API build documentation
- Model: resnet-50-tf, Error: ========== Skipping resnet-50-tf (model is unsupported in {'FP32-INT8'} precisions) HOT 1
- Crossroad demo does not fully process video HOT 4
- How to Postprocess data from product-detection-100 openvino model while usinv ovms HOT 1
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.