Skip to content

Commit

Permalink
feat: change the code according to sangyun884/HR-VITON/issues/45
Browse files Browse the repository at this point in the history
  • Loading branch information
yangcy1 committed May 24, 2023
1 parent 3c7bb71 commit 3fa5645
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions projects/DensePose/apply_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ def execute_on_outputs(
data = extractor(outputs)
image_vis = visualizer.visualize(image, data)
entry_idx = context["entry_idx"] + 1
out_fname = cls._get_out_fname(entry_idx, context["out_fname"])
out_dir = os.path.dirname(out_fname)
out_fname = './image-densepose/' + image_fpath.split('/')[-1]
out_dir = './image-densepose'
if len(out_dir) > 0 and not os.path.exists(out_dir):
os.makedirs(out_dir)
cv2.imwrite(out_fname, image_vis)
Expand Down
3 changes: 2 additions & 1 deletion projects/DensePose/densepose/vis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def visualize(self, image_bgr, mask, matrix, bbox_xywh):
if self.inplace:
image_target_bgr = image_bgr
else:
image_target_bgr = image_bgr * 0
image_target_bgr = image_bgr
image_target_bgr *= 0
x, y, w, h = [int(v) for v in bbox_xywh]
if w <= 0 or h <= 0:
return image_bgr
Expand Down
2 changes: 1 addition & 1 deletion projects/DensePose/densepose/vis/densepose_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def _bin_code_2_lines(self, arr, v, bin_code, multi_idx, Nw, Nh, offset):


class DensePoseResultsFineSegmentationVisualizer(DensePoseMaskedColormapResultsVisualizer):
def __init__(self, inplace=True, cmap=cv2.COLORMAP_PARULA, alpha=0.7, **kwargs):
def __init__(self, inplace=False, cmap=cv2.COLORMAP_PARULA, alpha=1, **kwargs):
super(DensePoseResultsFineSegmentationVisualizer, self).__init__(
_extract_i_from_iuvarr,
_extract_i_from_iuvarr,
Expand Down

0 comments on commit 3fa5645

Please sign in to comment.