1 Star 5 Fork 1

cubone/learnopencv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Download the Models

Run the getModels.sh file from command line to download the needed model files

sudo chmod a+x getModels.sh
./getModels.sh

How to run the code

Command line usage for object detection using YOLOv3

  • Python

    • Using CPU

      • A single image:
      python3 object_detection_yolo.py --image=bird.jpg --device 'cpu'
      
      • A video file:
      python3 object_detection_yolo.py --video=run.mp4 --device 'cpu'
      
    • Using GPU

      • A single image:
      python3 object_detection_yolo.py --image=bird.jpg --device 'gpu'
      
      • A video file:
      python3 object_detection_yolo.py --video=run.mp4 --device 'gpu'
      
  • C++:

    • Using CPU

      • A single image:
      ./build/object_detection_yolo --image=bird.jpg --device=cpu
      
      • A video file:
       ./build/object_detection_yolo --video=run.mp4 --device=cpu
      
    • Using GPU

      • A single image:
      ./build/object_detection_yolo --image=bird.jpg --device=gpu
      
      • A video file:
       ./build/object_detection_yolo --video=run.mp4 --device=gpu
      

Compilation examples

  • Using g++
g++ -ggdb pkg-config --cflags --libs /usr/local/Cellar/opencv3/3.4.2/lib/pkgconfig/opencv.pc object_detection_yolo.cpp -o object_detection_yolo.out
  • Using CMake

    • On Unix systems
    mkdir build && cd build
    cmake ..
    cmake --build . --config Release
    cd ..
    
    • On Windows systems
    mkdir build
    cd build
    cmake -G "Visual Studio 16 2019" ..
    cmake --build . --config Release
    cd ..
    

Note: To run on Windows system, change syntax accordingly:

.\build\Release\object_detection_yolo --video=run.mp4 --device=gpu

Results of YOLOv3

AI Courses by OpenCV

Want to become an expert in AI? AI Courses by OpenCV is a great place to start.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cubone/learnopencv.git
git@gitee.com:cubone/learnopencv.git
cubone
learnopencv
learnopencv
master

搜索帮助