-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkpoint for MaskRCNN and DensePose #11
base: master
Are you sure you want to change the base?
Conversation
Haotianz94
commented
May 6, 2019
- MaskRCNN: generate bbox & segmentation for all objects (COCO)
- Add build-arg "force_cuda" in travis, lead to conditional ENV in docker
- Add cocoapi into docker, which provides util for encoding/decoding segmentation mask to save space
- Fix DrawMaskRCNN kernel
- DensePose: generate bbox & keypoints & segmentation & UV parsing only for person
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a test for each kernel to tests/test_all.py
?
All_Coords[ entry[1] : entry[1]+output.shape[1],entry[0]:entry[0]+output.shape[2],:]= All_Coords_Old | ||
### | ||
# CurrentMask = (output[0,:,:]>0).astype(np.float32) | ||
# All_inds_old = All_inds[ entry[1] : entry[1]+output.shape[1],entry[0]:entry[0]+output.shape[2]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code
All_Coords[:,:,1:3] = 255. * All_Coords[:,:,1:3] | ||
All_Coords[All_Coords>255] = 255. | ||
All_Coords = All_Coords.astype(np.uint8) | ||
# All_inds = All_inds.astype(np.uint8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code
self.mask_shrink = 4 | ||
self.confidence_threshold = confidence_threshold | ||
self.min_image_size = min_image_size | ||
# self.mask_shrink = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code
mask_small = cv2.resize(mask, (W // self.mask_shrink, H // self.mask_shrink)) | ||
mask_small = (mask_small > 0).astype(np.uint8) * 255 | ||
return mask_small | ||
# def resize_mask(mask): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code
def encode_mask(mask): | ||
return mask_util.encode(np.asfortranarray(mask.transpose(1, 2, 0)))[0] | ||
|
||
result = [[{'bbox': {'x1' : float(bbox[0]), 'y1': float(bbox[1]), 'x2' : float(bbox[2]), 'y2' : float(bbox[3])}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these normalized bbox coordinates? That's the convention we use everywhere.
|
||
if not mask is None: | ||
# H, W = mask.shape | ||
# mask_large = cv2.resize(mask, (W * mask_shrink, H * mask_shrink)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code
result[:, :, c] * (1 - blending_alpha) + color[c] * blending_alpha, | ||
result[:, :, c]) | ||
# draw mask contour | ||
# thresh = (mask_large[..., None] > 0).astype(np.uint8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to respond to the previous unresolved comments please
Dockerfile
Outdated
&& cd DensePose \ | ||
&& pip3 install -r requirements.txt \ | ||
&& make \ | ||
#&&make ops \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code
assert len(output[0]) == 1 | ||
|
||
|
||
def test_densepose_detection(sc): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should get tagged with @needs_gpu()
Travis is failing in the build script: https://travis-ci.org/scanner-research/scannertools/jobs/531536501#L449 |