Giter Club home page Giter Club logo

docker_python-opencv-ffmpeg's Introduction

Docker: Python-OpenCV-FFmpeg(-CUDA)

Repository for clean Dockerfile containing FFmpeg, OpenCV4 and Python2/3, based on Ubuntu 20.04 LTS.

Tags

  • :cpu-pyX.y-cvX.y.z for Python 2.x/3.x, OpenCV 4.6.x, FFmpeg
  • :gpu-pyX.y-cvX.y.z for Python 2.x/3.x, OpenCV 4.6.x, FFmpeg with CUDA 11.4 support

Build

Publish Docker Image Docker Build Status DockerHub Pulls Docker

First you need to install docker on your local computer, see following tutorial. Note, for running the docker properly you have be logged as superuser otherwise you will face many partial issues which sometimes does not make much sense.

You can build it on your own, note it takes lots of time, be prepared.

git clone <git-repository>
cd docker_python-opencv-ffmpeg
docker image build -t python-opencv-ffmpeg:py3.8 -f gpu/Dockerfile --build-arg PYTHON_VERSION=3.8 .

To build other versions, select different Dockerfile.

docker image list
docker run --rm -it python-opencv-ffmpeg:py3.8 bash
docker image rm python-opencv-ffmpeg:py3.8

Other option is using already build image from DockerHub which is significantly faster. it basically download the already build image.

docker pull borda/docker_python-opencv-ffmpeg

Cleaning In case you fail with some builds, you may need to clean your local storage.

docker image prune

or Docker - How to cleanup (unused) resources

docker images | grep "none"
docker rmi $(docker images | grep "none" | awk '/ / { print $3 }')

or remove all - Some way to clean up

docker rm -vf $(docker ps -aq)
docker rmi -f $(docker images -aq)
docker volume prune -f

Usage

Image has OpenCV4, Python2.7/3.9 and FFmpeg ready to use. Example:

docker run --rm -it -v $PWD:/srv borda/docker_python-opencv-ffmpeg python
>>> import cv2; cv2.VideoCapture(0).read()
# truncated for transparency
(True, array([[[ 0, 43, 37], ...]], dtype=uint8))

Note, server usually doe not have webcam :)

docker_python-opencv-ffmpeg's People

Contributors

borda avatar valian avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.