Visaulize(可视化)#
fastdeploy.vision.vis_detection#
- class fastdeploy.vision.vis_detection(im_data, det_result, labels=[], score_threshold=0.0, line_size=1, font_size=0.5)[source]#
- Show the visualized results for detection models - Parameters
- im_data – (numpy.ndarray)The input image data, 3-D array with layout HWC, BGR format 
- det_result – the result produced by model 
- labels – (list of str) the visualized result will show the bounding box contain class label 
- score_threshold – (float) score_threshold threshold for result scores, the bounding box will not be shown if the score is less than score_threshold 
- line_size – (float) line_size line size for bounding boxes 
- font_size – (float) font_size font size for text 
 
- Returns
- (numpy.ndarray) image with visualized results 
 
fastdeploy.vision.vis_segmentation#
- class fastdeploy.vision.vis_segmentation(im_data, seg_result, weight=0.5)[source]#
- Show the visualized results for segmentation models - Parameters
- im_data – (numpy.ndarray)The input image data, 3-D array with layout HWC, BGR format 
- seg_result – the result produced by model 
- weight – (float)transparent weight of visualized result image 
 
- Returns
- (numpy.ndarray) image with visualized results 
 
fastdeploy.vision.vis_keypoint_detection#
- class fastdeploy.vision.vis_keypoint_detection(im_data, keypoint_det_result, conf_threshold=0.5)[source]#
- Show the visualized results for keypoint detection models - Parameters
- im_data – (numpy.ndarray)The input image data, 3-D array with layout HWC, BGR format 
- keypoint_det_result – the result produced by model 
- conf_threshold – (float) conf_threshold threshold for result scores, the bounding box will not be shown if the score is less than conf_threshold 
 
- Returns
- (numpy.ndarray) image with visualized results 
 
fastdeploy.vision.vis_face_detection#
- class fastdeploy.vision.vis_face_detection(im_data, face_det_result, line_size=1, font_size=0.5)[source]#
- Show the visualized results for face detection models - Parameters
- im_data – (numpy.ndarray)The input image data, 3-D array with layout HWC, BGR format 
- face_det_result – the result produced by model 
- line_size – (float) line_size line size for bounding boxes 
- font_size – (float) font_size font size for text 
 
- Returns
- (numpy.ndarray) image with visualized results 
 
fastdeploy.vision.vis_face_alignment#
- class fastdeploy.vision.vis_face_alignment(im_data, face_align_result, line_size=1)[source]#
- Show the visualized results for face alignment models - Parameters
- im_data – (numpy.ndarray)The input image data, 3-D array with layout HWC, BGR format 
- face_align_result – the result produced by model 
- line_size – (float)line_size line size for circle point 
 
- Returns
- (numpy.ndarray) image with visualized results 
 
fastdeploy.vision.vis_matting#
- class fastdeploy.vision.vis_matting(im_data, matting_result, transparent_background=False, transparent_threshold=0.99, remove_small_connected_area=False)[source]#
- Show the visualized results for matting models - Parameters
- im_data – (numpy.ndarray)The input image data, 3-D array with layout HWC, BGR format 
- matting_result – the result produced by model 
- transparent_background – whether visulizing matting result with transparent background 
- transparent_threshold – since the alpha value in MattringResult is a float between [0, 1], transparent_threshold is used to filter background pixel 
- remove_small_connected_area – (bool) if remove_small_connected_area==True, the visualized result will not include the small connected areas 
 
- Returns
- (numpy.ndarray) image with visualized results