Comments (7)
This depends on whether gstreamer's "v4l2src" is able to handle the camera device you are using. In other words, it's a compatibility issue between the camera and the gstreamer element. When you do "cv2.VideoCapture(0)", it's leveraging opencv's internal mechanism (probably "libv4l") to handle the camera instead. That's OK too.
I will keep my implementations since I'd like to be able to set different image resolutions, e.g. 1920x1080 or 1280x720, using the gstreamer pipeline.
from tensorrt_demos.
@jkjung-avt Is there a way to solve this compatibility problem? I want to use gstream.
from tensorrt_demos.
Check out 'v4l2src' documentation, and try to find a gstreamer pipeline which works for your webcam. If you manage to do that, then you could modify the 'open_cam_usb()' function accordingly.
https://gstreamer.freedesktop.org/documentation/video4linux2/v4l2src.html?gi-language=c
Using 'v4l2-ctl' to check all color/resolution formats your webcam supports would also help.
from tensorrt_demos.
could use MIPI CSI camera?Like Raspberry Pi Camera v2 in Jetson nano
from tensorrt_demos.
Yes, please refer to this post on my blog.
from tensorrt_demos.
Great repo, thanks!
for those who want to use with a ZED camera (like me):
- install the gstreamer plugin for the ZED
- in the file /tensorrt_demos/utils/camera.py replace:
gst_str = ('v4l2src device=/dev/video{} ! video/x-raw, width=(int){}, height=(int){} ! videoconvert ! appsink').format(dev, width, height)
with:
gst_str = ('zedsrc stream-type=1 camera-resolution=3 camera-fps=100 ! autovideoconvert ! appsink').format(dev, width, height)
you can tweak the zedsrc source with the parameters mentioned on the zed gstreamer plugin repo readme (e.g. camera-resolution = 0, 1, 2, 3 for resp. 2K, HD, 720p, WGA)
Then execute the demo like with any USB cam, e.g. under /tensorrt_demos/:
python3 trt_yolo.py --usb 0 -m yolov4-416
Hope this will help someone. ciao
from tensorrt_demos.
@Tetsujinfr Thanks for sharing this (use of ZED camera).
from tensorrt_demos.
Related Issues (20)
- Calib.table not created Deepstream
- Error when install install_pycuda.sh file HOT 2
- Any plan about SwinIR? HOT 1
- Batch Processed Image Inference HOT 2
- Failure to Build ONNX from Custom Yolo HOT 2
- Error when running on separate thread HOT 2
- wrong many bounding box and wrong predict untrained class id HOT 2
- error happening when sh ./install_pycuda.sh HOT 3
- Integration With AGX Orin HOT 4
- yolov3 onnx format with low opset, suitable for tensorrt 6.5 HOT 1
- Trouble with linker on yolo plugin x86 HOT 2
- Xavier onnx to TensorRT error HOT 1
- How to prevent tensorrt from fusing the final layers when trying to convert tiny yolov3 to int8? HOT 2
- No output when running my own yolov4
- Failed to build the TensorRT engine --int8
- How do I free up memory when I want to switch models
- Cudnn initialization error: I already installed Cudnn but Why?
- Is there any way to avoid using the reshape operation after inference?
- DRIVE AGX Orin
- Facing Issue with yolo to onnx conversion with pre-trained yolov3-tiny model.
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 tensorrt_demos.