wjf5203
commited on
Commit
·
e691814
1
Parent(s):
c5af0a2
add video func support
Browse files
app.py
CHANGED
|
@@ -131,6 +131,7 @@ if inference_type != 'LSJ':
|
|
| 131 |
|
| 132 |
|
| 133 |
def segment_image(img, prompt_mode, categoryname, custom_category, expressiong, results_select, num_inst_select, threshold_select, mask_image_mix_ration, model_selection):
|
|
|
|
| 134 |
if model_selection == 'GLEE-Plus (SwinL)':
|
| 135 |
GLEEmodel = GLEEmodel_swin
|
| 136 |
print('use GLEE-Plus')
|
|
@@ -409,7 +410,7 @@ def match_from_embds(tgt_embds, cur_embds):
|
|
| 409 |
|
| 410 |
|
| 411 |
def segment_video(video, prompt_mode, categoryname, custom_category, expressiong, results_select, num_inst_select, threshold_select, mask_image_mix_ration, model_selection,video_frames_select, prompter):
|
| 412 |
-
|
| 413 |
### model selection
|
| 414 |
if model_selection == 'GLEE-Plus (SwinL)':
|
| 415 |
GLEEmodel = GLEEmodel_swin
|
|
|
|
| 131 |
|
| 132 |
|
| 133 |
def segment_image(img, prompt_mode, categoryname, custom_category, expressiong, results_select, num_inst_select, threshold_select, mask_image_mix_ration, model_selection):
|
| 134 |
+
torch.cuda.empty_cache()
|
| 135 |
if model_selection == 'GLEE-Plus (SwinL)':
|
| 136 |
GLEEmodel = GLEEmodel_swin
|
| 137 |
print('use GLEE-Plus')
|
|
|
|
| 410 |
|
| 411 |
|
| 412 |
def segment_video(video, prompt_mode, categoryname, custom_category, expressiong, results_select, num_inst_select, threshold_select, mask_image_mix_ration, model_selection,video_frames_select, prompter):
|
| 413 |
+
torch.cuda.empty_cache()
|
| 414 |
### model selection
|
| 415 |
if model_selection == 'GLEE-Plus (SwinL)':
|
| 416 |
GLEEmodel = GLEEmodel_swin
|