Skip to content

Commit 9143c21

Browse files
committed
Initial commit
0 parents  commit 9143c21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2623
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Idea / PyCharm
2+
.idea/
3+
4+
# files from the mac
5+
.DS_Store
6+
7+
# Byte-compiled / optimized / DLL files
8+
__pycache__/
9+
*.py[cod]
10+
*.class
11+
12+
# Project dependant
13+
output/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Jarek Gilewski
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Detectron2 pipeline
2+
3+
Modular image processing pipeline using OpenCV and Python generators powered by [Detectron2](https://github.com/facebookresearch/detectron2).
4+
5+
For detailed description how to construct image processing pipeline using OpenCV and Python generators
6+
read the following Medium stories in order:
7+
* [Modular image processing pipeline using OpenCV and Python generators](https://medium.com/deepvisionguru/modular-image-processing-pipeline-using-opencv-and-python-generators-9edca3ccb696)
8+
* [Video processing pipeline with OpenCV](https://medium.com/deepvisionguru/video-processing-pipeline-with-opencv-ac10187d75b)
9+
* How to embed Detectron2 in your computer vision project
10+
11+
## Setup environment
12+
13+
This project is using [Conda](https://conda.io) for project environment management.
14+
15+
Setup the project environment:
16+
17+
$ conda env create -f environment.yml
18+
$ conda activate detectron2-pipeline
19+
20+
or update the environment if you `git pull` the repo previously:
21+
22+
$ conda env update -f environment.yml
23+
24+
Install Detectron2 in a folder one level above the `detectron2-pipeline` project folder
25+
26+
$ cd ..
27+
$ git clone https://github.com/facebookresearch/detectron2.git
28+
$ cd detectron2
29+
$ git checkout 3def12bdeaacd35c6f7b3b6c0097b7bc31f31ba4
30+
$ python setup.py build develop
31+
32+
We checkout `3def12bdeaacd35c6f7b3b6c0097b7bc31f31ba4` commit to ensure that you can use the code
33+
out of the box with this repo.
34+
35+
If you got any problems with Detectron2 installation please refer to
36+
[INSTALL.md](https://github.com/facebookresearch/detectron2/blob/3def12bdeaacd35c6f7b3b6c0097b7bc31f31ba4/INSTALL.md).
37+
38+
## Demo
39+
40+
Run the command to execute inferences on images from the selected folder:
41+
42+
$ python process_images.py -i assets/images/friends -p
43+
44+
By default the instance segmentation model is used from `configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml`.
45+
You can try other models with `--config-file` option, for example:
46+
47+
$ python process_images.py -i assets/images/friends -p --config-file configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml
48+
49+
For video processing run:
50+
51+
$ python process_video.py -i assets/videos/walk.small.mp4 -p -d -ov walk.small.mp4
52+
53+
## Tests
54+
55+
`pytest` is used as a test framework. All tests are stored in `tests` folder. Run the tests:
56+
57+
```bash
58+
$ pytest
59+
```
60+
61+
## Resources and Credits
62+
63+
* For Unix like pipeline idea credits goes to this [Gist](https://gist.github.com/alexmacedo/1552724)
64+
* The source of the example images and videos is [pixbay](https://pixabay.com)
65+
* Some ideas and code snippets are borrowed from [pyimagesearch](https://www.pyimagesearch.com/)
66+
* Color constants from [Python Color Constants Module](https://www.webucator.com/blog/2015/03/python-color-constants-module/)
67+
* [Detectron2](https://github.com/facebookresearch/detectron2)
68+
* [Applications of Foreground-Background separation with Semantic Segmentation](https://www.learnopencv.com/applications-of-foreground-background-separation-with-semantic-segmentation/)
69+
70+
## License
71+
72+
[MIT License](LICENSE)
69.2 KB
Loading
129 KB
Loading
52.6 KB
Loading
1.58 MB
Loading
40.5 KB
Loading
64.2 KB
Loading

assets/images/others/balloons.jpg

67.1 KB
Loading

0 commit comments

Comments
 (0)