Skip to content

Commit

Permalink
[Enhancement] Add pixel value clip in visualizer (#1365)
Browse files Browse the repository at this point in the history
add pixel value clip in visualizer
  • Loading branch information
LeoXing1996 authored Oct 30, 2022
1 parent 38f805a commit da10b0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mmedit/visualization/gen_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _post_process_image(image: Tensor,
mean: mean_std_type = None,
std: mean_std_type = None) -> Tensor:
"""Post process images. First convert image to `rgb` order. And then
de-norm image to fid `mean` and `std` if `mean` and `std` is passed.
de-norm image to `mean` and `std` if they are passed.
Args:
image (Tensor): Image to pose process.
Expand All @@ -73,7 +73,7 @@ def _post_process_image(image: Tensor,
image = image[:, [2, 1, 0], ...]
if mean is not None and std is not None:
image = image * std + mean
return image
return image.clamp(0, 255)

@staticmethod
def _get_n_row_and_padding(samples: Tuple[dict, Tensor],
Expand Down

0 comments on commit da10b0f

Please sign in to comment.