Comments (13)
ok here is my dockerfile for future reference. works with latest builds. and has ffmpeg support.
FROM nvcr.io/nvidia/l4t-pytorch:r32.5.0-pth1.6-py3
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install -y cmake libgtk2.0-dev wget
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install ffmpeg
RUN python3 -m pip install opencv-python
RUN wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.8.0-cp36-cp36m-linux_aarch64.whl
RUN python3 -m pip install torch-1.8.0-cp36-cp36m-linux_aarch64.whl
RUN git clone https://github.com/pytorch/vision torchvision
RUN cd torchvision && git checkout v0.9.0 && python3 setup.py install
RUN python3 -m pip install scikit-build
RUN python3 -m pip install ffmpeg
RUN python3 -m pip install opencv-python
RUN git clone https://github.com/ultralytics/yolov5.git
RUN cd yolov5 && python3 -m pip install -r requirements.txt
WORKDIR /yolov5
from dockerfile-yolov5-jetson.
from dockerfile-yolov5-jetson.
Changing back to the 5.0 image fixed the problem. But now I'm having trouble testing on an MP4. Do i need to install a lib for the MP4 format?
from dockerfile-yolov5-jetson.
Another day and no progress. No matter what i try i can't open an mp4 in the container.
video = cv2.VideoCapture('all_colors.MP4')
fps = video.get(cv2.CAP_PROP_FPS)
print(fps)
^works on the jetson. but always fails in the container returning 0. That means i can't run the container with a video as the source. Any advice?
from dockerfile-yolov5-jetson.
rebuilt opencv with -D OPENCV_FFMPEG_SKIP_BUILD_CHECK=ON \
^ fixed problem i think.
from dockerfile-yolov5-jetson.
My environment is:
jetson@jetson-desktop:~/dockerfile-yolov5-jetson$ cat /etc/nv_tegra_release
# R32 (release), REVISION: 5.1, GCID: 26202423, BOARD: t210ref, EABI: aarch64, DATE: Fri Feb 19 16:45:52 UTC 2021
And I'm not good at torch, but on my environment, the instruction you mentioned doesn't show any error.
root@jetson-desktop:/yolov5# python3
Python 3.6.9 (default, Oct 8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
>>> device = torch.device("cuda")
>>> device
device(type='cuda')
>>> torch.rand(10)
tensor([0.9158, 0.7678, 0.5396, 0.6999, 0.3756, 0.8283, 0.8684, 0.6938, 0.5391,
0.3479])
>>> torch.rand(10)
tensor([0.9311, 0.3135, 0.5782, 0.3391, 0.7750, 0.6705, 0.5390, 0.0953, 0.6380,
0.4314])
>>> torch.rand(10).to(device)
tensor([0.4091, 0.0234, 0.1496, 0.8245, 0.9412, 0.9183, 0.3809, 0.7819, 0.1235,
0.5110], device='cuda:0')
from dockerfile-yolov5-jetson.
rebuilt opencv with -D OPENCV_FFMPEG_SKIP_BUILD_CHECK=ON \
^ fixed problem i think.
I'm not sure, but I think this is not a issue for this repository, right?
from dockerfile-yolov5-jetson.
Thanks for your input, It'll take me a few days to process it sorry. Just a noob tying to nut this out and there isn't a ton of information out there.
While i couldn't get it to work running the latest downloaded image from nvidia, going back to 5.0 solved it but i couldn't work out why. The running the command i mentioned on an mp4 failed because there was no link from opencv to ffmpeg. Hopefully I'm on top of it now. I'll post back here a step by step once i nail it down.
Thanks again for sharing your work.
from dockerfile-yolov5-jetson.
@xrstokes
print(cv2.getBuildInformation())
says:
...
Video I/O:
DC1394: NO
FFMPEG: NO
avcodec: NO
avformat: NO
avutil: NO
swscale: NO
avresample: NO
GStreamer: NO
v4l/v4l2: YES (linux/videodev2.h)
So actually FFMPEG does not seem to be enabled.
from dockerfile-yolov5-jetson.
any idea how i can make ffmpeg enabled? I've been trying for 2 days. I need to be able to run tests on mpegs as well as on camera.
from dockerfile-yolov5-jetson.
cmake shows this.
-- Video I/O:
-- DC1394: YES (2.2.5)
-- FFMPEG: YES
-- avcodec: YES (57.107.100)
-- avformat: YES (57.83.100)
-- avutil: YES (55.78.100)
-- swscale: YES (4.8.100)
-- avresample: YES (3.7.0)
-- GStreamer: YES (1.14.5)
-- v4l/v4l2: YES (linux/videodev2.h)
but then when it's finished. The version has changed wo i know it installed. but print(cv2.getBuildInformation()) says: NO.
weird.
from dockerfile-yolov5-jetson.
DOH! It wasn't working when i installed ffmpeg with apt. If i install it with pip it works. Sorry to bother you.
from dockerfile-yolov5-jetson.
@xrstokes 77c133a supports ffmpeg.
from dockerfile-yolov5-jetson.
Related Issues (14)
- jetpack 4.5 support HOT 2
- Dockerfile Failed to clone 'opencv_extra' at step 15/19 HOT 2
- Purpose of the Dockerfile Base Image if we are installing torch and torchvision? HOT 4
- Is it possible to reduce launch time? HOT 4
- OCI runtime create failed: HOT 2
- Build.sh complains about unknown JetPack version even though I'm on 4.6 HOT 2
- ImportError: /usr/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block HOT 7
- Wrong Python Version HOT 5
- [SOLVED] docker: unknown server OS: .
- Failed to load module "canberra-gtk-module" using MIPI CSI Camera HOT 8
- Run Yolov5 on host environment instead of container HOT 2
- Cannot run yolov5 on Python3.6 HOT 2
- Jetsonnano + YOLOv5 could not work on python 3.6.9 HOT 16
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 dockerfile-yolov5-jetson.