项目作者: jagin

项目描述 :
Modular image processing pipeline using OpenCV and Python generators powered by Detectron2.
高级语言: Python
项目地址: git://github.com/jagin/detectron2-pipeline.git
创建时间: 2019-11-28T12:39:31Z
项目社区:https://github.com/jagin/detectron2-pipeline

开源协议:MIT License

下载


Detectron2 pipeline

Modular image processing pipeline using OpenCV and Python generators powered by Detectron2.

For detailed description how to construct image processing pipeline using OpenCV and Python generators
read the following Medium stories in order:

Setup environment

This project is using Conda for project environment management.

Setup the project environment:

  1. $ conda env create -f environment.yml
  2. $ conda activate detectron2-pipeline

or update the environment if you git pull the repo previously:

  1. $ conda env update -f environment.yml

Install Detectron2 in a folder one level above the detectron2-pipeline project folder

  1. $ cd ..
  2. $ git clone https://github.com/facebookresearch/detectron2.git
  3. $ cd detectron2
  4. $ git checkout 3def12bdeaacd35c6f7b3b6c0097b7bc31f31ba4
  5. $ python setup.py build develop

We checkout 3def12bdeaacd35c6f7b3b6c0097b7bc31f31ba4 commit to ensure that you can use the code
out of the box with this repo.

If you got any problems with Detectron2 installation please refer to
INSTALL.md.

Demo

Run the command to execute inferences on images from the selected folder:

  1. $ python process_images.py -i assets/images/friends -p

By default the instance segmentation model is used from configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml.
You can try other models with --config-file option, for example:

  1. $ python process_images.py -i assets/images/friends -p --config-file configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml

For video processing run:

  1. $ python process_video.py -i assets/videos/walk.small.mp4 -p -d -ov walk.small.mp4

Tests

pytest is used as a test framework. All tests are stored in tests folder. Run the tests:

  1. $ pytest

Resources and Credits

License

MIT License