wjf5203
commited on
Commit
·
c5af0a2
1
Parent(s):
d565de0
add video func support
Browse files
app.py
CHANGED
|
@@ -729,7 +729,6 @@ def segment_video(video, prompt_mode, categoryname, custom_category, expressiong
|
|
| 729 |
img_n = 255*img_n/max_p
|
| 730 |
ret = (~lar_valid*copyed_img)*mask_image_mix_ration + img_n
|
| 731 |
ret = ret.astype('uint8')
|
| 732 |
-
# import pdb;pdb.set_trace()
|
| 733 |
# cv2.imwrite('00020_inst.jpg', cv2.cvtColor(ret, cv2.COLOR_BGR2RGB))
|
| 734 |
|
| 735 |
output_vos_results = []
|
|
@@ -773,7 +772,6 @@ def segment_video(video, prompt_mode, categoryname, custom_category, expressiong
|
|
| 773 |
cur_obj_id=1
|
| 774 |
frame_image, padding_size,re_size,ori_height, ori_width = process_frames(frame_list[frame_idx:frame_idx+1])
|
| 775 |
prompt_list["spatial"] = [exist_obj_dict[cur_obj_id]]
|
| 776 |
-
# import pdb;pdb.set_trace()
|
| 777 |
language_dict_features_init = copy.deepcopy(language_dict_features_dict_init[cur_obj_id]) # Important
|
| 778 |
language_dict_features_prev = copy.deepcopy(language_dict_features_dict_prev[cur_obj_id]) # Important
|
| 779 |
language_dict_features_cur = {}
|
|
@@ -859,7 +857,6 @@ def segment_video(video, prompt_mode, categoryname, custom_category, expressiong
|
|
| 859 |
|
| 860 |
def visual_prompt_preview(img, prompt_mode):
|
| 861 |
copyed_img = img['background'][:,:,:3].copy()
|
| 862 |
-
import pdb;pdb.set_trace()
|
| 863 |
# get bbox from scribbles in layers
|
| 864 |
bbox_list = [scribble2box(layer) for layer in img['layers'] ]
|
| 865 |
zero_mask = np.zeros_like(copyed_img)
|
|
|
|
| 729 |
img_n = 255*img_n/max_p
|
| 730 |
ret = (~lar_valid*copyed_img)*mask_image_mix_ration + img_n
|
| 731 |
ret = ret.astype('uint8')
|
|
|
|
| 732 |
# cv2.imwrite('00020_inst.jpg', cv2.cvtColor(ret, cv2.COLOR_BGR2RGB))
|
| 733 |
|
| 734 |
output_vos_results = []
|
|
|
|
| 772 |
cur_obj_id=1
|
| 773 |
frame_image, padding_size,re_size,ori_height, ori_width = process_frames(frame_list[frame_idx:frame_idx+1])
|
| 774 |
prompt_list["spatial"] = [exist_obj_dict[cur_obj_id]]
|
|
|
|
| 775 |
language_dict_features_init = copy.deepcopy(language_dict_features_dict_init[cur_obj_id]) # Important
|
| 776 |
language_dict_features_prev = copy.deepcopy(language_dict_features_dict_prev[cur_obj_id]) # Important
|
| 777 |
language_dict_features_cur = {}
|
|
|
|
| 857 |
|
| 858 |
def visual_prompt_preview(img, prompt_mode):
|
| 859 |
copyed_img = img['background'][:,:,:3].copy()
|
|
|
|
| 860 |
# get bbox from scribbles in layers
|
| 861 |
bbox_list = [scribble2box(layer) for layer in img['layers'] ]
|
| 862 |
zero_mask = np.zeros_like(copyed_img)
|