Skip to content
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

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

Checkpoint for MaskRCNN and DensePose #11

wants to merge 31 commits into from

Conversation

Haotianz94
Copy link
Contributor

  1. 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
  1. DensePose: generate bbox & keypoints & segmentation & UV parsing only for person

Copy link
Member

@willcrichton willcrichton left a 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]]
Copy link
Member

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)
Copy link
Member

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
Copy link
Member

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):
Copy link
Member

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])},
Copy link
Member

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))
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code

@Haotianz94 Haotianz94 requested a review from willcrichton May 12, 2019 22:00
Copy link
Member

@willcrichton willcrichton left a 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 \
Copy link
Member

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):
Copy link
Member

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()

@willcrichton
Copy link
Member

Travis is failing in the build script: https://travis-ci.org/scanner-research/scannertools/jobs/531536501#L449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants