Skip to content

Commit c17756f

Browse files
adding some more example
1 parent e8a0731 commit c17756f

File tree

9 files changed

+26
-1
lines changed

9 files changed

+26
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ venv.bak/
4545

4646
# others
4747
test.py
48+
*.h5
49+
*.caffemodel
50+
*.mp4
51+
inference_model/

23. PixelLib Segmentation/README.md

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
""" Instance Segmentation using PixelLib and Mask_Rcnn Pretained model on coco dataset """
2+
3+
import pixellib
4+
from PIL import Image
5+
from pixellib.instance import instance_segmentation
6+
7+
model_path = "./assets/mask_rcnn_coco.h5"
8+
image_path = "./Media/road.jpg"
9+
image_output = './media/road_segmentation.jpg'
10+
11+
# creating instace
12+
segment_image = instance_segmentation()
13+
segment_image.load_model(model_path)
14+
15+
# applying semantic segmentation
16+
segment_image.segmentImage(image_path, show_bboxes = True, output_image_name=image_output)
17+
18+
# showing the output
19+
img = Image.open(image_output)
20+
img.show()

Media/card.png

-70.5 KB
Binary file not shown.

Media/heart.png

-2.46 KB
Binary file not shown.

Media/road.jpg

136 KB
Loading

Media/road_segmentation.jpg

244 KB
Loading

requirements.txt

-2.12 KB
Binary file not shown.

utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
download_dict = {
44
"16gAKScYAW0bZkyRgcLF71x28du_mLY8-": "assets/res10_300x300_ssd_iter_140000.caffemodel",
5-
"1jUIwxXjxz8oC7I2Ta9vtiozsB4i95043": "Media/people-walking.mp4"
5+
"1jUIwxXjxz8oC7I2Ta9vtiozsB4i95043": "Media/people-walking.mp4",
6+
"1Q7qfr11olEFguRRkKRnC1Yah3ZnJCUnM": "assets/mask_rcnn_coco.h5"
67
}
78

89
for file_id, dest_path in download_dict.items():

0 commit comments

Comments
 (0)