xiuyul commited on
Commit
c95d2d4
1 Parent(s): 4fdd498

initial files upload

Browse files
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ files/*.mp4 filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ __pycache__/
2
+ .DS_Store
3
+ *.gif
4
+ gradio_cached_examples/
app.py ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import gradio as gr
3
+ import pandas as pd
4
+
5
+
6
+ BASELINE = f'<a target="_blank" href=https://github.com/showlab/loveu-tgve-2023 style="color: blue; text-decoration: underline;text-decoration-style: dotted;">Tune-A-Video (Baseline)</a>'
7
+ COLS = ["Method", "CLIPScore (Frame Consistency) ⬆️", "CLIPScore (Text Alignment) ⬆️", "PickScore ⬆️", "Human Preference ⬆️", "References"]
8
+ TYPES = ["markdown", "number", "number", "number", "str", "markdown"]
9
+
10
+
11
+ def get_leaderboard():
12
+ all_data = []
13
+
14
+ baseline_0 = {
15
+ "Method": '**Tune-A-Video**',
16
+ "CLIPScore (Frame Consistency) ⬆️":0.92,
17
+ "CLIPScore (Text Alignment) ⬆️":27.12,
18
+ "PickScore ⬆️":20.36,
19
+ "Human Preference ⬆️":'',
20
+ "References": ','.join([f'<a target="_blank" href="https://arxiv.org/abs/2212.11565" style="color: blue">Paper</a>',
21
+ f'<a target="_blank" href="https://github.com/showlab/Tune-A-Video" style="color: blue">Code</a>',
22
+ f'<a target="_blank" href="https://tuneavideo.github.io/" style="color: blue">Website</a>',
23
+ f'<a target="_blank" href="https://huggingface.co/spaces/Tune-A-Video-library/Tune-A-Video-inference" style="color: blue">Demo</a>'])
24
+ }
25
+ baseline_1 = {
26
+ "Method": 'VideoCrafter (todo)',
27
+ "References": ','.join([f'<a target="_blank" href="https://github.com/VideoCrafter/VideoCrafter" style="color: blue">Code</a>',
28
+ f'<a target="_blank" href="https://huggingface.co/spaces/VideoCrafter/VideoCrafter" style="color: blue">Demo</a>'])
29
+ }
30
+ all_data += [baseline_0, baseline_1]
31
+
32
+ dataframe = pd.DataFrame.from_records(all_data)
33
+ dataframe = dataframe.sort_values(by=['PickScore ⬆️'], ascending=False)
34
+ print(dataframe)
35
+ dataframe = dataframe[COLS]
36
+ return dataframe
37
+
38
+ leaderboard = get_leaderboard()
39
+
40
+ def refresh():
41
+ return get_leaderboard()
42
+
43
+ def load_edited_video(source_video, *args):
44
+ result = source_video.split('/')[-1].split('.mp4')[0] + '-edit.mp4'
45
+ return os.path.join(os.path.dirname(__file__), f"files/{result}")
46
+
47
+
48
+ block = gr.Blocks()
49
+ with block:
50
+ with gr.Tab("Leaderboard"):
51
+ with gr.Row():
52
+ gr.Markdown(f"""
53
+ # 🤗 LOVEU-TGVE @ CVPR 2023 Leaderboard
54
+ <font size="4">
55
+ <b>Welcome to the <a href="https://sites.google.com/view/loveucvpr23/track4" target="_blank">Text-Guided Video Editing (TGVE)</a> competition leaderboard of <a href="https://sites.google.com/view/loveucvpr23/home" target="_blank">LOVEU Workshop @ CVPR 2023</a>!</b>
56
+
57
+ Leveraging AI for video editing has the potential to unleash creativity for artists across all skill levels. The rapidly-advancing field of Text-Guided Video Editing (TGVE) is here to address this challenge. Recent works in this field include <a href="https://tuneavideo.github.io/" target="_blank">Tune-A-Video</a>, <a href="https://research.runwayml.com/gen2" target="_blank">Gen-2</a>, and <a href="https://dreamix-video-editing.github.io/" target="_blank">Dreamix</a>.
58
+ In this competition track, we provide a standard set of videos and prompts. As a researcher, you will develop a model that takes a video and a prompt for how to edit it, and your model will produce an edited video. For instance, you might be given a video of “a man is surfing inside the barrel of a wave,” and your model will edit the video to “a man is surfing on a wave made of aurora borealis.”
59
+
60
+ During the competition, evaluation results performed against the following 3 automatic metrics will be displayed on the leaderboard:
61
+ - <a href="https://arxiv.org/abs/2103.00020" target="_blank">CLIPScore</a> (Frame Consistency) - the average cosine similarity between all pairs of CLIP image embeddings computed on all frames of output videos.
62
+ - <a href="https://arxiv.org/abs/2103.00020" target="_blank">CLIPScore</a> (Text Alignment) - the average CLIP score between all frames of output videos and corresponding edited prompts.
63
+ - <a href="https://arxiv.org/abs/2305.01569" target="_blank">PickScore</a> - the average PickScore between all frames of output videos.
64
+
65
+ After all submissions are uploaded, we will run a human-evaluation of all submitted videos. Specifically, we will have human labelers compare all submitted videos. Labelers will evaluate videos on the following criteria:
66
+
67
+ - Text alignment: How well does the generated video match the caption?
68
+ - Structure: How well does the generated video preserve the structure of the original video?
69
+ - Quality: Aesthetically, how good is this video?
70
+
71
+ We will choose a winner and a runner-up based on the human evaluation results.
72
+ </font>
73
+
74
+ The **bold** method name indicates that the implementation is **official** (by the author / developer of the original method).""")
75
+
76
+ with gr.Row():
77
+ leaderboard_table = gr.components.Dataframe(value=leaderboard, headers=COLS,
78
+ datatype=TYPES, max_rows=10)
79
+ with gr.Row():
80
+ refresh_button = gr.Button("Refresh")
81
+ refresh_button.click(refresh, inputs=[], outputs=[leaderboard_table])
82
+ block.load(refresh, inputs=[], outputs=[leaderboard_table])
83
+
84
+ with gr.Tab("Baseline Demo"):
85
+ with gr.Row():
86
+ gr.Markdown(f"""Some examples generated by {BASELINE} are shown below.""")
87
+ with gr.Row():
88
+ with gr.Column():
89
+ source_video = gr.Video(type="file", label='Source Video', format="mp4", interactive=True)
90
+ source_prompt = gr.Textbox(label='Source Prompt',
91
+ # info='A good prompt describes each frame and most objects in video. Especially, it has the object or attribute that we want to edit or preserve.',
92
+ max_lines=2,
93
+ placeholder='Example: "A cat in the grass in the sun."',
94
+ # value='A cat in the grass in the sun.'
95
+ )
96
+
97
+ with gr.Column():
98
+ result = gr.Video(type="file", label='Edited Video', format="mp4", interactive=True)
99
+ editing_prompt = gr.Textbox(label='Editing Prompt',
100
+ # info='A reasonable composition of video may achieve better results(e.g., "sunflower" video with "Van Gogh" prompt is better than "sunflower" with "Monet")',
101
+ max_lines=2,
102
+ placeholder='Example: "A dog in the grass in the sun."',
103
+ # value='A dog in the grass in the sun.'
104
+ )
105
+
106
+ with gr.Row():
107
+ from example import examples
108
+ gr.Examples(examples=examples,
109
+ inputs=[source_video, source_prompt, editing_prompt],
110
+ outputs=result,
111
+ fn=load_edited_video,
112
+ cache_examples=True,
113
+ )
114
+ block.launch()
example.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+
4
+ examples = [
5
+ [os.path.join(os.path.dirname(__file__), "files/cat-in-the-sun.mp4"),
6
+ 'A cat in the grass in the sun.',
7
+ 'A dog in the grass in the sun.'],
8
+ [os.path.join(os.path.dirname(__file__), "files/surfer-on-wave.mp4"),
9
+ 'A man is surfing inside the barrel of a wave.',
10
+ 'A man is surfing on a wave made of aurora borealis.'],
11
+ [os.path.join(os.path.dirname(__file__), "files/red-roses-sunny-day.mp4"),
12
+ 'A static shot of red roses in sunlight, gently swaying in the breeze.',
13
+ 'A static shot of red roses in sunlight, gently swaying in the breeze, origami style.'],
14
+ [os.path.join(os.path.dirname(__file__), "files/earth-full-view.mp4"),
15
+ 'Full view of the Earth as it moves slowly toward the sun.',
16
+ 'Full view of the Earth as it moves slowly through a fireworks display.'],
17
+ [os.path.join(os.path.dirname(__file__), "files/ship-sailing.mp4"),
18
+ 'A ship sails on the sea during sunset.',
19
+ 'A ship sails on the sea during sunset, 2D vector art.'],
20
+ [os.path.join(os.path.dirname(__file__), "files/sunset-beach-yoga.mp4"),
21
+ 'A woman does yoga on the beach during sunset.',
22
+ 'A panda does yoga on the beach during sunset.'],
23
+ [os.path.join(os.path.dirname(__file__), "files/las-vegas-time-lapse.mp4"),
24
+ 'A mesmerizing time-lapse showcasing iconic architectures amidst the cityscape of Las Vegas in night.',
25
+ 'A mesmerizing time-lapse showcasing iconic architectures amidst the cityscape of New York in night.'],
26
+ [os.path.join(os.path.dirname(__file__), "files/gold-fish.mp4"),
27
+ 'Several goldfish swim in a tank.',
28
+ 'Several sharks swim in a tank.'],
29
+ [os.path.join(os.path.dirname(__file__), "files/bird-on-feeder.mp4"),
30
+ 'A brown bird sits on a feeder that is being hung by a red string.',
31
+ 'A brown squirrel sits on a feeder that is being hung by a red string.'],
32
+ [os.path.join(os.path.dirname(__file__), "files/sharks-swimming.mp4"),
33
+ 'Two grey sharks swim in the blue ocean on a coral reef.',
34
+ 'Two quadrotor drones swim in the blue ocean on a coral reef.'],
35
+ ]
files/bird-on-feeder-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b22afb38ddaa80225e267bff0fcef7eaf03a4016fc1d20206189758a1bcd7d9
3
+ size 2801107
files/bird-on-feeder.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c288cbd85064510bd64bc5dfe0a3adafa2bfd025b0012614454d77d3d319df5
3
+ size 1345796
files/cat-in-the-sun-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0dae8f5493ea977623f1b8013c24e739c525126408d93dcb0a2ca66c42507dff
3
+ size 3281141
files/cat-in-the-sun.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89e90b0c23da0a5d3f66edb55befaa51bfa579d215c46a88cf9a4731e8841e57
3
+ size 1215272
files/earth-full-view-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7348332fe5d0d63e1cf5819643c8ec4186a6e2e412009528877f9b68187a0bd4
3
+ size 3279505
files/earth-full-view.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:350b59f1ac6f9efb03718de67002256bc75155fe4e819e1c359e326fc4a96b64
3
+ size 1186554
files/gold-fish-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:938e27894d3c9d2281d09d84e9bed9faa40f9141d8059e00f7d07170a99acf1f
3
+ size 3240881
files/gold-fish.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:90f0a1c012fc8e7db252409da3361bdeb999f138057279027d4d13a911ceb05a
3
+ size 1236588
files/las-vegas-time-lapse-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e1ba6e83ffaf27243c6b61d4f2ea50b77b80dea3f4fbaa2f00c0b138f2a671f
3
+ size 2670173
files/las-vegas-time-lapse.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8508c6832cbd4391082e4a6d5e6fad1745ad0dae14fac579c864f380ce75da0a
3
+ size 1264239
files/red-roses-sunny-day-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e95a95e6dc4956c110fbe3540094e820c7a58bae4c1c9ff31b253b2eca3a7b4
3
+ size 3131316
files/red-roses-sunny-day.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:614826f410c8c0d6366b5c873051f1f38abb11dc6a128c9a414d728eeed139de
3
+ size 1232182
files/sharks-swimming-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a29a5d592b4374c3baba596b71ed10d261b7b5e303f262cc27c2d751cb764d3
3
+ size 3320788
files/sharks-swimming.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67e62534642dcf9f94873b3bfbf9d6ec58c6da934885997e27afe89c32f7cc3b
3
+ size 1750076
files/ship-sailing-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c32e565e237276d9f9ba70db987fe73691e157847500601b0b0a35a23cfeeee
3
+ size 1925050
files/ship-sailing.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81198e3f149e460da1233bca3137dd03c563953b148d5031fcd8809ff47638f0
3
+ size 1729069
files/sunset-beach-yoga-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ef8c94a5534e2b72fb4d2cab3db82ec2c811e343983ec01eb2ab7905e6fa72d
3
+ size 2672716
files/sunset-beach-yoga.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53c9baa98ddfc60422dddb415a10f0a99d7d3dc7eee559910cd410717883e41a
3
+ size 1559230
files/surfer-on-wave-edit.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71ee8e0fba75de4953d6f25c78cc98ef29f896dd49c65b4e8f2f88335950597a
3
+ size 2700156
files/surfer-on-wave.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd58f430e613e28139258a62d8df11a17320c9d7e1fb3d0499de39ac587be845
3
+ size 1215909
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ apscheduler==3.10.1
2
+ gradio==3.30.0
3
+ huggingface_hub==0.14.1
4
+ numpy==1.24.2
5
+ pandas==2.0.1
6
+ transformers==4.29.1