@@ -52,7 +52,7 @@ def update(self):
52
52
continue
53
53
54
54
depth_image = np .asanyarray (aligned_depth_frame .get_data ())
55
- depth_colormap = cv2 .applyColorMap (cv2 .convertScaleAbs (depth_image , alpha = 0.1 ), cv2 .COLORMAP_RAINBOW )
55
+ depth_colormap = cv2 .applyColorMap (cv2 .convertScaleAbs (depth_image , alpha = 0.06 ), cv2 .COLORMAP_RAINBOW )
56
56
depth_colormap = cv2 .resize (depth_colormap , (320 ,180 ))
57
57
depth_colormap = cv2 .flip (depth_colormap , 1 )
58
58
@@ -117,15 +117,15 @@ class InferenceConfig(coco.CocoConfig):
117
117
'bus' , 'train' , 'truck' , 'boat' , 'traffic light' ,
118
118
'fire hydrant' , 'stop sign' , 'parking meter' , 'bench' , 'bird' ,
119
119
'cat' , 'dog' , 'horse' , 'sheep' , 'cow' , 'elephant' , 'bear' ,
120
- 'zebra' , 'giraffe' , 'backpack ' , 'umbrella' , 'handbag ' , 'tie' ,
121
- 'suitcase' , 'frisbee' , 'skis' , 'snowboard' , 'sports ball' ,
120
+ 'zebra' , 'giraffe' , 'bag ' , 'umbrella' , 'bag ' , 'tie' ,
121
+ 'suitcase' , 'frisbee' , 'skis' , 'snowboard' , 'ball' ,
122
122
'kite' , 'baseball bat' , 'baseball glove' , 'skateboard' ,
123
123
'surfboard' , 'tennis racket' , 'bottle' , 'wine glass' , 'cup' ,
124
124
'fork' , 'knife' , 'spoon' , 'bowl' , 'banana' , 'apple' ,
125
125
'sandwich' , 'orange' , 'broccoli' , 'carrot' , 'hot dog' , 'pizza' ,
126
126
'donut' , 'cake' , 'chair' , 'couch' , 'potted plant' , 'bed' ,
127
- 'dining table' , 'toilet' , 'tv ' , 'laptop' , 'mouse' , 'remote' ,
128
- 'keyboard' , 'cell phone' , 'microwave' , 'oven' , 'toaster' ,
127
+ 'table' , 'toilet' , 'monitor ' , 'laptop' , 'mouse' , 'remote' ,
128
+ 'keyboard' , 'phone' , 'microwave' , 'oven' , 'toaster' ,
129
129
'sink' , 'refrigerator' , 'book' , 'clock' , 'vase' , 'scissors' ,
130
130
'teddy bear' , 'hair drier' , 'toothbrush' ]
131
131
@@ -140,7 +140,7 @@ class InferenceConfig(coco.CocoConfig):
140
140
cv2 .namedWindow ("window" , cv2 .WND_PROP_FULLSCREEN )
141
141
cv2 .setWindowProperty ("window" ,cv2 .WND_PROP_FULLSCREEN ,cv2 .WINDOW_FULLSCREEN )
142
142
143
- N = 20
143
+ N = 12
144
144
hsv = [(i / N , 1 , 1.0 ) for i in range (N )]
145
145
colors = list (map (lambda c : colorsys .hsv_to_rgb (* c ), hsv ))
146
146
@@ -172,7 +172,7 @@ def render_masks(image, boxes, masks, class_ids, N):
172
172
(1 - alpha ) + alpha * color [2 ] * 255 ,
173
173
image [:, :, 2 ])
174
174
175
- cv2 .putText (image ,caption ,(cent_x , cent_y ), font , 0.8 ,(255 , 255 ,255 ), 1 , cv2 .LINE_AA )
175
+ cv2 .putText (image ,caption ,(cent_x , cent_y ), font , 0.8 ,(60 , 60 ,255 ), 2 , cv2 .LINE_AA )
176
176
177
177
return image
178
178
@@ -187,6 +187,8 @@ def render_masks(image, boxes, masks, class_ids, N):
187
187
boxes , masks = r ["rois" ], r ["masks" ]
188
188
class_ids = r ["class_ids" ]
189
189
N = boxes .shape [0 ]
190
+ if N > 12 :
191
+ N = 12
190
192
191
193
if not N :
192
194
masked_image = color_image_f
0 commit comments