wjf5203
commited on
Commit
·
789873b
1
Parent(s):
6f9e6c2
add examples
Browse files- .gitattributes +20 -0
- GLEE_logo.png +3 -0
- app.py +191 -5
.gitattributes
CHANGED
|
@@ -33,3 +33,23 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
GLEE_logo.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
Examples/1.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
Examples/00000.jpg filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
Examples/sa_7842964.jpg filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
Examples/sa_7842967.jpg filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
Examples/sa_7842994.jpg filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
Examples/sa_7842976.jpg filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
Examples/sa_7842992.jpg filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
Examples/sa_7842993.jpg filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
Examples/000000001000.jpg filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
Examples/000000340697.jpg filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
Examples/000000480122.jpg filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
Examples/20231222.jpg filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
Examples/cat.jpg filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
Examples/bike.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
Examples/horse.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
Examples/racing_car2.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
Examples/racing_car3.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
Examples/street.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
Examples/train.mp4 filter=lfs diff=lfs merge=lfs -text
|
GLEE_logo.png
ADDED
|
Git LFS Details
|
app.py
CHANGED
|
@@ -893,10 +893,188 @@ def visual_prompt_preview(img, prompt_mode):
|
|
| 893 |
ret = ret.astype('uint8')
|
| 894 |
return ret
|
| 895 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 896 |
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
| 897 |
-
gr.Markdown('# GLEE: General Object Foundation Model for Images and Videos at Scale')
|
| 898 |
|
| 899 |
-
|
| 900 |
|
| 901 |
gr.Markdown(' [Paper](https://arxiv.org/abs/2312.09158) —— [Project Page](https://glee-vision.github.io) —— [Code](https://github.com/FoundationVision/GLEE) ')
|
| 902 |
# gr.HTML(“img src=“image link” alt=“A beautiful landscape”)
|
|
@@ -933,7 +1111,7 @@ with gr.Blocks(theme=gr.themes.Default()) as demo:
|
|
| 933 |
input_expressiong = gr.Textbox(
|
| 934 |
label="Expression",
|
| 935 |
info="Input any description of an object in the image ",
|
| 936 |
-
lines=
|
| 937 |
visible=False,
|
| 938 |
value="the red car",
|
| 939 |
)
|
|
@@ -1035,7 +1213,11 @@ with gr.Blocks(theme=gr.themes.Default()) as demo:
|
|
| 1035 |
image_button = gr.Button("Detect & Segment")
|
| 1036 |
img_input.change(visual_prompt_preview, inputs = [img_input,prompt_mode_select] , outputs = img_showbox)
|
| 1037 |
image_button.click(segment_image, inputs=[img_input, prompt_mode_select, category_select, custom_category,input_expressiong, results_select, num_inst_select, threshold_select, mask_image_mix_ration,model_select], outputs=image_segment)
|
| 1038 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1039 |
|
| 1040 |
with gr.Tab("Video task"):
|
| 1041 |
gr.Markdown(
|
|
@@ -1187,7 +1369,11 @@ with gr.Blocks(theme=gr.themes.Default()) as demo:
|
|
| 1187 |
video_prompt_preview.click(visual_prompt_preview, inputs = [video_visual_prompter,video_prompt_mode_select] , outputs = video_img_showbox)
|
| 1188 |
video_button = gr.Button("Segment&Track")
|
| 1189 |
video_button.click(segment_video, inputs=[video_input, video_prompt_mode_select, video_category_select, video_custom_category, video_input_expressiong, video_results_select, video_num_inst_select, video_threshold_select, video_mask_image_mix_ration, video_model_select, video_frames_select, video_visual_prompter], outputs=video_output)
|
| 1190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1191 |
|
| 1192 |
|
| 1193 |
|
|
|
|
| 893 |
ret = ret.astype('uint8')
|
| 894 |
return ret
|
| 895 |
|
| 896 |
+
|
| 897 |
+
|
| 898 |
+
|
| 899 |
+
image_example_list = [
|
| 900 |
+
[
|
| 901 |
+
this_dir + "/Examples/000000480122.jpg",
|
| 902 |
+
"categories",
|
| 903 |
+
"OBJ365",
|
| 904 |
+
"",
|
| 905 |
+
"",
|
| 906 |
+
"50",
|
| 907 |
+
],
|
| 908 |
+
[
|
| 909 |
+
this_dir + "/Examples/20231222.jpg",
|
| 910 |
+
"expression",
|
| 911 |
+
"COCO-80",
|
| 912 |
+
"",
|
| 913 |
+
"a purple star holding by a person ",
|
| 914 |
+
],
|
| 915 |
+
[
|
| 916 |
+
this_dir + "/Examples/000000001000.jpg",
|
| 917 |
+
"expression",
|
| 918 |
+
"COCO-80",
|
| 919 |
+
"",
|
| 920 |
+
"the left boy",
|
| 921 |
+
],
|
| 922 |
+
[
|
| 923 |
+
this_dir + "/Examples/000000001000.jpg",
|
| 924 |
+
"expression",
|
| 925 |
+
"COCO-80",
|
| 926 |
+
"",
|
| 927 |
+
"the left girl",
|
| 928 |
+
],
|
| 929 |
+
[
|
| 930 |
+
this_dir + "/Examples/1.png",
|
| 931 |
+
"categories",
|
| 932 |
+
"Custom-List",
|
| 933 |
+
"manholecover, bollard, person, car, motobike",
|
| 934 |
+
"",
|
| 935 |
+
"10",
|
| 936 |
+
],
|
| 937 |
+
[
|
| 938 |
+
this_dir + "/Examples/cat.jpg",
|
| 939 |
+
"categories",
|
| 940 |
+
"Custom-List",
|
| 941 |
+
"cat_eye, cat_ear, candle",
|
| 942 |
+
" ",
|
| 943 |
+
"10",
|
| 944 |
+
],
|
| 945 |
+
[
|
| 946 |
+
this_dir + "/Examples/00000.jpg",
|
| 947 |
+
"categories",
|
| 948 |
+
"COCO-80",
|
| 949 |
+
"",
|
| 950 |
+
"",
|
| 951 |
+
"20",
|
| 952 |
+
],
|
| 953 |
+
|
| 954 |
+
[
|
| 955 |
+
this_dir + "/Examples/000000340697.jpg",
|
| 956 |
+
"categories",
|
| 957 |
+
"COCO-80",
|
| 958 |
+
"",
|
| 959 |
+
"",
|
| 960 |
+
"20",
|
| 961 |
+
],
|
| 962 |
+
[
|
| 963 |
+
this_dir + "/Examples/sa_7842964.jpg",
|
| 964 |
+
"categories",
|
| 965 |
+
"COCO-80",
|
| 966 |
+
"",
|
| 967 |
+
"",
|
| 968 |
+
"20",
|
| 969 |
+
],
|
| 970 |
+
[
|
| 971 |
+
this_dir + "/Examples/1.png",
|
| 972 |
+
"categories",
|
| 973 |
+
"OBJ365",
|
| 974 |
+
"",
|
| 975 |
+
"",
|
| 976 |
+
"50",
|
| 977 |
+
],
|
| 978 |
+
[
|
| 979 |
+
this_dir + "/Examples/sa_7842967.jpg",
|
| 980 |
+
"categories",
|
| 981 |
+
"COCO-80",
|
| 982 |
+
"",
|
| 983 |
+
"",
|
| 984 |
+
"20",
|
| 985 |
+
],
|
| 986 |
+
[
|
| 987 |
+
this_dir + "/Examples/sa_7842976.jpg",
|
| 988 |
+
"categories",
|
| 989 |
+
"COCO-80",
|
| 990 |
+
"",
|
| 991 |
+
"",
|
| 992 |
+
"20",
|
| 993 |
+
],
|
| 994 |
+
[
|
| 995 |
+
this_dir + "/Examples/sa_7842992.jpg",
|
| 996 |
+
"categories",
|
| 997 |
+
"COCO-80",
|
| 998 |
+
"",
|
| 999 |
+
"",
|
| 1000 |
+
"20",
|
| 1001 |
+
],
|
| 1002 |
+
[
|
| 1003 |
+
this_dir + "/Examples/sa_7842994.jpg",
|
| 1004 |
+
"categories",
|
| 1005 |
+
"COCO-80",
|
| 1006 |
+
"",
|
| 1007 |
+
"",
|
| 1008 |
+
"20",
|
| 1009 |
+
],
|
| 1010 |
+
|
| 1011 |
+
|
| 1012 |
+
]
|
| 1013 |
+
|
| 1014 |
+
|
| 1015 |
+
video_example_list = [
|
| 1016 |
+
[
|
| 1017 |
+
this_dir + "/Examples/bike.mp4",
|
| 1018 |
+
"categories",
|
| 1019 |
+
"COCO-80",
|
| 1020 |
+
"",
|
| 1021 |
+
"",
|
| 1022 |
+
"10",
|
| 1023 |
+
],
|
| 1024 |
+
[
|
| 1025 |
+
this_dir + "/Examples/bike.mp4",
|
| 1026 |
+
"categories",
|
| 1027 |
+
"Custom-List",
|
| 1028 |
+
"backpack, bollard",
|
| 1029 |
+
"",
|
| 1030 |
+
"5",
|
| 1031 |
+
],
|
| 1032 |
+
[
|
| 1033 |
+
this_dir + "/Examples/horse.mp4",
|
| 1034 |
+
"expression",
|
| 1035 |
+
"",
|
| 1036 |
+
"",
|
| 1037 |
+
"the left horse",
|
| 1038 |
+
"10",
|
| 1039 |
+
],
|
| 1040 |
+
[
|
| 1041 |
+
this_dir + "/Examples/racing_car2.mp4",
|
| 1042 |
+
"categories",
|
| 1043 |
+
"COCO-80",
|
| 1044 |
+
"",
|
| 1045 |
+
"",
|
| 1046 |
+
"15",
|
| 1047 |
+
],
|
| 1048 |
+
[
|
| 1049 |
+
this_dir + "/Examples/racing_car3.mp4",
|
| 1050 |
+
"categories",
|
| 1051 |
+
"COCO-80",
|
| 1052 |
+
"",
|
| 1053 |
+
"",
|
| 1054 |
+
"15",
|
| 1055 |
+
],
|
| 1056 |
+
[
|
| 1057 |
+
this_dir + "/Examples/street.mp4",
|
| 1058 |
+
"categories",
|
| 1059 |
+
"OBJ365",
|
| 1060 |
+
"",
|
| 1061 |
+
"",
|
| 1062 |
+
"15",
|
| 1063 |
+
],
|
| 1064 |
+
[
|
| 1065 |
+
this_dir + "/Examples/train.mp4",
|
| 1066 |
+
"categories",
|
| 1067 |
+
"COCO-80",
|
| 1068 |
+
"",
|
| 1069 |
+
"",
|
| 1070 |
+
"15",
|
| 1071 |
+
],
|
| 1072 |
+
]
|
| 1073 |
+
|
| 1074 |
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
| 1075 |
+
# gr.Markdown('# GLEE: General Object Foundation Model for Images and Videos at Scale')
|
| 1076 |
|
| 1077 |
+
gr.HTML("<p> <img src='/file=GLEE_logo.png' aligh='center' style='float:left' width='80' > <h1 class='title is-1 publication-title'> <p style='margin-left: 20px'> GLEE: General Object Foundation Model for Images and Videos at Scale </h1> ")
|
| 1078 |
|
| 1079 |
gr.Markdown(' [Paper](https://arxiv.org/abs/2312.09158) —— [Project Page](https://glee-vision.github.io) —— [Code](https://github.com/FoundationVision/GLEE) ')
|
| 1080 |
# gr.HTML(“img src=“image link” alt=“A beautiful landscape”)
|
|
|
|
| 1111 |
input_expressiong = gr.Textbox(
|
| 1112 |
label="Expression",
|
| 1113 |
info="Input any description of an object in the image ",
|
| 1114 |
+
lines=1,
|
| 1115 |
visible=False,
|
| 1116 |
value="the red car",
|
| 1117 |
)
|
|
|
|
| 1213 |
image_button = gr.Button("Detect & Segment")
|
| 1214 |
img_input.change(visual_prompt_preview, inputs = [img_input,prompt_mode_select] , outputs = img_showbox)
|
| 1215 |
image_button.click(segment_image, inputs=[img_input, prompt_mode_select, category_select, custom_category,input_expressiong, results_select, num_inst_select, threshold_select, mask_image_mix_ration,model_select], outputs=image_segment)
|
| 1216 |
+
gr.Examples(
|
| 1217 |
+
examples = image_example_list,
|
| 1218 |
+
inputs=[img_input, prompt_mode_select, category_select, custom_category,input_expressiong,num_inst_select],
|
| 1219 |
+
examples_per_page=20
|
| 1220 |
+
)
|
| 1221 |
|
| 1222 |
with gr.Tab("Video task"):
|
| 1223 |
gr.Markdown(
|
|
|
|
| 1369 |
video_prompt_preview.click(visual_prompt_preview, inputs = [video_visual_prompter,video_prompt_mode_select] , outputs = video_img_showbox)
|
| 1370 |
video_button = gr.Button("Segment&Track")
|
| 1371 |
video_button.click(segment_video, inputs=[video_input, video_prompt_mode_select, video_category_select, video_custom_category, video_input_expressiong, video_results_select, video_num_inst_select, video_threshold_select, video_mask_image_mix_ration, video_model_select, video_frames_select, video_visual_prompter], outputs=video_output)
|
| 1372 |
+
gr.Examples(
|
| 1373 |
+
examples = video_example_list,
|
| 1374 |
+
inputs=[video_input, video_prompt_mode_select, video_category_select, video_custom_category, video_input_expressiong,video_num_inst_select],
|
| 1375 |
+
examples_per_page=20
|
| 1376 |
+
)
|
| 1377 |
|
| 1378 |
|
| 1379 |
|