Imran1 commited on
Commit
eb53b5d
Β·
verified Β·
1 Parent(s): e4baa78

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +146 -0
app.py ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ # Suppress root pip warning & disable Gradio Node.js SSR proxy
4
+ os.environ["PIP_ROOT_USER_ACTION"] = "ignore"
5
+ os.environ["GRADIO_SSR_MODE"] = "false"
6
+ os.environ["GRADIO_DISABLE_SSR"] = "1"
7
+
8
+ import gradio as gr
9
+
10
+ RESOURCES = [
11
+ {
12
+ "name": "Vidi (ByteDance)",
13
+ "category": "Video Model",
14
+ "description": "ByteDance's multimodal video understanding and generation framework.",
15
+ "links": [
16
+ ("πŸ™ GitHub", "https://github.com/bytedance/vidi"),
17
+ ("πŸš€ Live Demo", "https://vidi.byteintl.com"),
18
+ ],
19
+ },
20
+ {
21
+ "name": "Molmo2-8B (AllenAI)",
22
+ "category": "Open-Weight VLM",
23
+ "description": "AllenAI's open multimodal vision-language model for rich video and image reasoning.",
24
+ "links": [
25
+ ("πŸ€— Hugging Face", "https://huggingface.co/allenai/Molmo2-8B"),
26
+ ("πŸš€ Playground Demo", "https://playground.allenai.org/?model=molmo2-8b"),
27
+ ("πŸ“ Blog Post", "https://allenai.org/blog/molmo2"),
28
+ ("▢️ YouTube Video", "https://youtu.be/Ej3Hb3kRiac"),
29
+ ],
30
+ },
31
+ {
32
+ "name": "VideoLLaMA 3 (DAMO-NLP-SG)",
33
+ "category": "Video-LLM",
34
+ "description": "Frontier multimodal foundation model tailored for image and video understanding.",
35
+ "links": [
36
+ ("πŸ™ GitHub", "https://github.com/DAMO-NLP-SG/VideoLLaMA3"),
37
+ ("πŸš€ HF Space Demo", "https://huggingface.co/spaces/lixin4ever/VideoLLaMA3"),
38
+ ],
39
+ },
40
+ {
41
+ "name": "VideoJev-35B-A3B",
42
+ "category": "MoE Video-LLM",
43
+ "description": "35B total parameter (3B active) Mixture-of-Experts model for efficient video understanding.",
44
+ "links": [
45
+ ("πŸ€— Hugging Face", "https://huggingface.co/ZhuYuhan/VideoJev-35B-A3B"),
46
+ ("πŸš€ HF Space Demo", "https://huggingface.co/spaces/hugging-apps/videojev-35b-a3b"),
47
+ ],
48
+ },
49
+ {
50
+ "name": "Gemini Agentic Video Understanding",
51
+ "category": "API & Developer Guides",
52
+ "description": "Official Google AI Studio and Gemini API guides for agentic video reasoning and frame-level understanding.",
53
+ "links": [
54
+ ("πŸ› οΈ AI Studio Developer Guide", "https://aistudio.google.com/learn/agentic-video-understanding-with-gemini"),
55
+ ("πŸ“š Gemini Video Docs", "https://ai.google.dev/gemini-api/docs/video-understanding"),
56
+ ],
57
+ },
58
+ ]
59
+
60
+
61
+ def filter_resources(search_query: str, category_filter: str) -> str:
62
+ query = (search_query or "").strip().lower()
63
+ sections = []
64
+
65
+ for item in RESOURCES:
66
+ if category_filter != "All" and item["category"] != category_filter:
67
+ continue
68
+ if query and (
69
+ query not in item["name"].lower()
70
+ and query not in item["description"].lower()
71
+ and query not in item["category"].lower()
72
+ ):
73
+ continue
74
+
75
+ links_md = "  |  ".join(
76
+ f"**[{label}]({url})**" for label, url in item["links"]
77
+ )
78
+ section = (
79
+ f"### {item['name']} `[{item['category']}]`\n"
80
+ f"{item['description']}\n\n"
81
+ f"πŸ”— {links_md}\n\n---"
82
+ )
83
+ sections.append(section)
84
+
85
+ if not sections:
86
+ return "### No matching models or resources found."
87
+
88
+ return "\n\n".join(sections)
89
+
90
+
91
+ categories = ["All"] + sorted(list({r["category"] for r in RESOURCES}))
92
+
93
+ with gr.Blocks(title="Video Understanding Models & Demos Hub") as demo:
94
+ gr.Markdown(
95
+ """
96
+ # 🎬 Video Understanding Models, Demos & Resources
97
+ Quick-access directory of multimodal video foundation models, Hugging Face checkpoints, interactive playgrounds, and developer guides.
98
+ """
99
+ )
100
+
101
+ with gr.Row():
102
+ search_box = gr.Textbox(
103
+ label="Search Models / Links",
104
+ placeholder="Filter by keyword (e.g., Molmo, VideoLLaMA, Gemini, ByteDance, Vidi)...",
105
+ scale=3,
106
+ )
107
+ category_dropdown = gr.Dropdown(
108
+ choices=categories,
109
+ value="All",
110
+ label="Category",
111
+ scale=1,
112
+ )
113
+
114
+ gr.Markdown("---")
115
+ results_markdown = gr.Markdown(value=filter_resources("", "All"))
116
+
117
+ with gr.Accordion("πŸ“‹ Summary Comparison Table", open=True):
118
+ gr.Markdown(
119
+ """
120
+ | Model / Resource | Category | Model / Repo Link | Live Demo / Space | Extra Links |
121
+ | :--- | :--- | :--- | :--- | :--- |
122
+ | **Vidi (ByteDance)** | Video Model | [GitHub](https://github.com/bytedance/vidi) | [Vidi Demo](https://vidi.byteintl.com) | β€” |
123
+ | **Molmo2-8B (AllenAI)** | Open-Weight VLM | [Hugging Face](https://huggingface.co/allenai/Molmo2-8B) | [AllenAI Playground](https://playground.allenai.org/?model=molmo2-8b) | [Blog](https://allenai.org/blog/molmo2) Β· [YouTube](https://youtu.be/Ej3Hb3kRiac) |
124
+ | **VideoLLaMA 3** | Video-LLM | [GitHub](https://github.com/DAMO-NLP-SG/VideoLLaMA3) | [HF Space](https://huggingface.co/spaces/lixin4ever/VideoLLaMA3) | β€” |
125
+ | **VideoJev-35B-A3B** | MoE Video-LLM | [Hugging Face](https://huggingface.co/ZhuYuhan/VideoJev-35B-A3B) | [HF Space](https://huggingface.co/spaces/hugging-apps/videojev-35b-a3b) | β€” |
126
+ | **Gemini Video Understanding** | API & Developer Guides | [AI Studio Guide](https://aistudio.google.com/learn/agentic-video-understanding-with-gemini) | β€” | [API Docs](https://ai.google.dev/gemini-api/docs/video-understanding) |
127
+ """
128
+ )
129
+
130
+ search_box.change(
131
+ fn=filter_resources,
132
+ inputs=[search_box, category_dropdown],
133
+ outputs=results_markdown,
134
+ )
135
+ category_dropdown.change(
136
+ fn=filter_resources,
137
+ inputs=[search_box, category_dropdown],
138
+ outputs=results_markdown,
139
+ )
140
+
141
+ if __name__ == "__main__":
142
+ # Force the app to bind properly to the Hugging Face container port
143
+ try:
144
+ demo.launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False)
145
+ except TypeError:
146
+ demo.launch(server_name="0.0.0.0", server_port=7860)