ControlNet commited on
Commit
7143262
Β·
verified Β·
1 Parent(s): 2eea92e

Upload 9 files

Browse files
CITATION.cff ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cff-version: 1.2.0
2
+ message: "If you find this work useful in your research, please cite it."
3
+ preferred-citation:
4
+ type: conference-paper
5
+ title: "MARLIN: Masked Autoencoder for facial video Representation LearnINg"
6
+ authors:
7
+ - family-names: "Cai"
8
+ given-names: "Zhixi"
9
+ - family-names: "Ghosh"
10
+ given-names: "Shreya"
11
+ - family-names: "Stefanov"
12
+ given-names: "Kalin"
13
+ - family-names: "Dhall"
14
+ given-names: "Abhinav"
15
+ - family-names: "Cai"
16
+ given-names: "Jianfei"
17
+ - family-names: "Rezatofighi"
18
+ given-names: "Hamid"
19
+ - family-names: "Haffari"
20
+ given-names: "Reza"
21
+ - family-names: "Hayat"
22
+ given-names: "Munawar"
23
+ collection-title: "Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition"
24
+ year: 2023
25
+ location:
26
+ name: "Vancouver, Canada"
27
+ start: 1493
28
+ end: 1504
29
+ doi: 10.1109/CVPR52729.2023.00150
LICENSE.txt ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Attribution-NonCommercial 4.0 International
3
+
4
+ =======================================================================
5
+
6
+ Creative Commons Corporation ("Creative Commons") is not a law firm and
7
+ does not provide legal services or legal advice. Distribution of
8
+ Creative Commons public licenses does not create a lawyer-client or
9
+ other relationship. Creative Commons makes its licenses and related
10
+ information available on an "as-is" basis. Creative Commons gives no
11
+ warranties regarding its licenses, any material licensed under their
12
+ terms and conditions, or any related information. Creative Commons
13
+ disclaims all liability for damages resulting from their use to the
14
+ fullest extent possible.
15
+
16
+ Using Creative Commons Public Licenses
17
+
18
+ Creative Commons public licenses provide a standard set of terms and
19
+ conditions that creators and other rights holders may use to share
20
+ original works of authorship and other material subject to copyright
21
+ and certain other rights specified in the public license below. The
22
+ following considerations are for informational purposes only, are not
23
+ exhaustive, and do not form part of our licenses.
24
+
25
+ Considerations for licensors: Our public licenses are
26
+ intended for use by those authorized to give the public
27
+ permission to use material in ways otherwise restricted by
28
+ copyright and certain other rights. Our licenses are
29
+ irrevocable. Licensors should read and understand the terms
30
+ and conditions of the license they choose before applying it.
31
+ Licensors should also secure all rights necessary before
32
+ applying our licenses so that the public can reuse the
33
+ material as expected. Licensors should clearly mark any
34
+ material not subject to the license. This includes other CC-
35
+ licensed material, or material used under an exception or
36
+ limitation to copyright. More considerations for licensors:
37
+ wiki.creativecommons.org/Considerations_for_licensors
38
+
39
+ Considerations for the public: By using one of our public
40
+ licenses, a licensor grants the public permission to use the
41
+ licensed material under specified terms and conditions. If
42
+ the licensor's permission is not necessary for any reason--for
43
+ example, because of any applicable exception or limitation to
44
+ copyright--then that use is not regulated by the license. Our
45
+ licenses grant only permissions under copyright and certain
46
+ other rights that a licensor has authority to grant. Use of
47
+ the licensed material may still be restricted for other
48
+ reasons, including because others have copyright or other
49
+ rights in the material. A licensor may make special requests,
50
+ such as asking that all changes be marked or described.
51
+ Although not required by our licenses, you are encouraged to
52
+ respect those requests where reasonable. More_considerations
53
+ for the public:
54
+ wiki.creativecommons.org/Considerations_for_licensees
55
+
56
+ =======================================================================
57
+
58
+ Creative Commons Attribution-NonCommercial 4.0 International Public
59
+ License
60
+
61
+ By exercising the Licensed Rights (defined below), You accept and agree
62
+ to be bound by the terms and conditions of this Creative Commons
63
+ Attribution-NonCommercial 4.0 International Public License ("Public
64
+ License"). To the extent this Public License may be interpreted as a
65
+ contract, You are granted the Licensed Rights in consideration of Your
66
+ acceptance of these terms and conditions, and the Licensor grants You
67
+ such rights in consideration of benefits the Licensor receives from
68
+ making the Licensed Material available under these terms and
69
+ conditions.
70
+
71
+ Section 1 -- Definitions.
72
+
73
+ a. Adapted Material means material subject to Copyright and Similar
74
+ Rights that is derived from or based upon the Licensed Material
75
+ and in which the Licensed Material is translated, altered,
76
+ arranged, transformed, or otherwise modified in a manner requiring
77
+ permission under the Copyright and Similar Rights held by the
78
+ Licensor. For purposes of this Public License, where the Licensed
79
+ Material is a musical work, performance, or sound recording,
80
+ Adapted Material is always produced where the Licensed Material is
81
+ synched in timed relation with a moving image.
82
+
83
+ b. Adapter's License means the license You apply to Your Copyright
84
+ and Similar Rights in Your contributions to Adapted Material in
85
+ accordance with the terms and conditions of this Public License.
86
+
87
+ c. Copyright and Similar Rights means copyright and/or similar rights
88
+ closely related to copyright including, without limitation,
89
+ performance, broadcast, sound recording, and Sui Generis Database
90
+ Rights, without regard to how the rights are labeled or
91
+ categorized. For purposes of this Public License, the rights
92
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
93
+ Rights.
94
+ d. Effective Technological Measures means those measures that, in the
95
+ absence of proper authority, may not be circumvented under laws
96
+ fulfilling obligations under Article 11 of the WIPO Copyright
97
+ Treaty adopted on December 20, 1996, and/or similar international
98
+ agreements.
99
+
100
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
101
+ any other exception or limitation to Copyright and Similar Rights
102
+ that applies to Your use of the Licensed Material.
103
+
104
+ f. Licensed Material means the artistic or literary work, database,
105
+ or other material to which the Licensor applied this Public
106
+ License.
107
+
108
+ g. Licensed Rights means the rights granted to You subject to the
109
+ terms and conditions of this Public License, which are limited to
110
+ all Copyright and Similar Rights that apply to Your use of the
111
+ Licensed Material and that the Licensor has authority to license.
112
+
113
+ h. Licensor means the individual(s) or entity(ies) granting rights
114
+ under this Public License.
115
+
116
+ i. NonCommercial means not primarily intended for or directed towards
117
+ commercial advantage or monetary compensation. For purposes of
118
+ this Public License, the exchange of the Licensed Material for
119
+ other material subject to Copyright and Similar Rights by digital
120
+ file-sharing or similar means is NonCommercial provided there is
121
+ no payment of monetary compensation in connection with the
122
+ exchange.
123
+
124
+ j. Share means to provide material to the public by any means or
125
+ process that requires permission under the Licensed Rights, such
126
+ as reproduction, public display, public performance, distribution,
127
+ dissemination, communication, or importation, and to make material
128
+ available to the public including in ways that members of the
129
+ public may access the material from a place and at a time
130
+ individually chosen by them.
131
+
132
+ k. Sui Generis Database Rights means rights other than copyright
133
+ resulting from Directive 96/9/EC of the European Parliament and of
134
+ the Council of 11 March 1996 on the legal protection of databases,
135
+ as amended and/or succeeded, as well as other essentially
136
+ equivalent rights anywhere in the world.
137
+
138
+ l. You means the individual or entity exercising the Licensed Rights
139
+ under this Public License. Your has a corresponding meaning.
140
+
141
+ Section 2 -- Scope.
142
+
143
+ a. License grant.
144
+
145
+ 1. Subject to the terms and conditions of this Public License,
146
+ the Licensor hereby grants You a worldwide, royalty-free,
147
+ non-sublicensable, non-exclusive, irrevocable license to
148
+ exercise the Licensed Rights in the Licensed Material to:
149
+
150
+ a. reproduce and Share the Licensed Material, in whole or
151
+ in part, for NonCommercial purposes only; and
152
+
153
+ b. produce, reproduce, and Share Adapted Material for
154
+ NonCommercial purposes only.
155
+
156
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
157
+ Exceptions and Limitations apply to Your use, this Public
158
+ License does not apply, and You do not need to comply with
159
+ its terms and conditions.
160
+
161
+ 3. Term. The term of this Public License is specified in Section
162
+ 6(a).
163
+
164
+ 4. Media and formats; technical modifications allowed. The
165
+ Licensor authorizes You to exercise the Licensed Rights in
166
+ all media and formats whether now known or hereafter created,
167
+ and to make technical modifications necessary to do so. The
168
+ Licensor waives and/or agrees not to assert any right or
169
+ authority to forbid You from making technical modifications
170
+ necessary to exercise the Licensed Rights, including
171
+ technical modifications necessary to circumvent Effective
172
+ Technological Measures. For purposes of this Public License,
173
+ simply making modifications authorized by this Section 2(a)
174
+ (4) never produces Adapted Material.
175
+
176
+ 5. Downstream recipients.
177
+
178
+ a. Offer from the Licensor -- Licensed Material. Every
179
+ recipient of the Licensed Material automatically
180
+ receives an offer from the Licensor to exercise the
181
+ Licensed Rights under the terms and conditions of this
182
+ Public License.
183
+
184
+ b. No downstream restrictions. You may not offer or impose
185
+ any additional or different terms or conditions on, or
186
+ apply any Effective Technological Measures to, the
187
+ Licensed Material if doing so restricts exercise of the
188
+ Licensed Rights by any recipient of the Licensed
189
+ Material.
190
+
191
+ 6. No endorsement. Nothing in this Public License constitutes or
192
+ may be construed as permission to assert or imply that You
193
+ are, or that Your use of the Licensed Material is, connected
194
+ with, or sponsored, endorsed, or granted official status by,
195
+ the Licensor or others designated to receive attribution as
196
+ provided in Section 3(a)(1)(A)(i).
197
+
198
+ b. Other rights.
199
+
200
+ 1. Moral rights, such as the right of integrity, are not
201
+ licensed under this Public License, nor are publicity,
202
+ privacy, and/or other similar personality rights; however, to
203
+ the extent possible, the Licensor waives and/or agrees not to
204
+ assert any such rights held by the Licensor to the limited
205
+ extent necessary to allow You to exercise the Licensed
206
+ Rights, but not otherwise.
207
+
208
+ 2. Patent and trademark rights are not licensed under this
209
+ Public License.
210
+
211
+ 3. To the extent possible, the Licensor waives any right to
212
+ collect royalties from You for the exercise of the Licensed
213
+ Rights, whether directly or through a collecting society
214
+ under any voluntary or waivable statutory or compulsory
215
+ licensing scheme. In all other cases the Licensor expressly
216
+ reserves any right to collect such royalties, including when
217
+ the Licensed Material is used other than for NonCommercial
218
+ purposes.
219
+
220
+ Section 3 -- License Conditions.
221
+
222
+ Your exercise of the Licensed Rights is expressly made subject to the
223
+ following conditions.
224
+
225
+ a. Attribution.
226
+
227
+ 1. If You Share the Licensed Material (including in modified
228
+ form), You must:
229
+
230
+ a. retain the following if it is supplied by the Licensor
231
+ with the Licensed Material:
232
+
233
+ i. identification of the creator(s) of the Licensed
234
+ Material and any others designated to receive
235
+ attribution, in any reasonable manner requested by
236
+ the Licensor (including by pseudonym if
237
+ designated);
238
+
239
+ ii. a copyright notice;
240
+
241
+ iii. a notice that refers to this Public License;
242
+
243
+ iv. a notice that refers to the disclaimer of
244
+ warranties;
245
+
246
+ v. a URI or hyperlink to the Licensed Material to the
247
+ extent reasonably practicable;
248
+
249
+ b. indicate if You modified the Licensed Material and
250
+ retain an indication of any previous modifications; and
251
+
252
+ c. indicate the Licensed Material is licensed under this
253
+ Public License, and include the text of, or the URI or
254
+ hyperlink to, this Public License.
255
+
256
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
257
+ reasonable manner based on the medium, means, and context in
258
+ which You Share the Licensed Material. For example, it may be
259
+ reasonable to satisfy the conditions by providing a URI or
260
+ hyperlink to a resource that includes the required
261
+ information.
262
+
263
+ 3. If requested by the Licensor, You must remove any of the
264
+ information required by Section 3(a)(1)(A) to the extent
265
+ reasonably practicable.
266
+
267
+ 4. If You Share Adapted Material You produce, the Adapter's
268
+ License You apply must not prevent recipients of the Adapted
269
+ Material from complying with this Public License.
270
+
271
+ Section 4 -- Sui Generis Database Rights.
272
+
273
+ Where the Licensed Rights include Sui Generis Database Rights that
274
+ apply to Your use of the Licensed Material:
275
+
276
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
277
+ to extract, reuse, reproduce, and Share all or a substantial
278
+ portion of the contents of the database for NonCommercial purposes
279
+ only;
280
+
281
+ b. if You include all or a substantial portion of the database
282
+ contents in a database in which You have Sui Generis Database
283
+ Rights, then the database in which You have Sui Generis Database
284
+ Rights (but not its individual contents) is Adapted Material; and
285
+
286
+ c. You must comply with the conditions in Section 3(a) if You Share
287
+ all or a substantial portion of the contents of the database.
288
+
289
+ For the avoidance of doubt, this Section 4 supplements and does not
290
+ replace Your obligations under this Public License where the Licensed
291
+ Rights include other Copyright and Similar Rights.
292
+
293
+ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
294
+
295
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
296
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
297
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
298
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
299
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
300
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
301
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
302
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
303
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
304
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
305
+
306
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
307
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
308
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
309
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
310
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
311
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
312
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
313
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
314
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
315
+
316
+ c. The disclaimer of warranties and limitation of liability provided
317
+ above shall be interpreted in a manner that, to the extent
318
+ possible, most closely approximates an absolute disclaimer and
319
+ waiver of all liability.
320
+
321
+ Section 6 -- Term and Termination.
322
+
323
+ a. This Public License applies for the term of the Copyright and
324
+ Similar Rights licensed here. However, if You fail to comply with
325
+ this Public License, then Your rights under this Public License
326
+ terminate automatically.
327
+
328
+ b. Where Your right to use the Licensed Material has terminated under
329
+ Section 6(a), it reinstates:
330
+
331
+ 1. automatically as of the date the violation is cured, provided
332
+ it is cured within 30 days of Your discovery of the
333
+ violation; or
334
+
335
+ 2. upon express reinstatement by the Licensor.
336
+
337
+ For the avoidance of doubt, this Section 6(b) does not affect any
338
+ right the Licensor may have to seek remedies for Your violations
339
+ of this Public License.
340
+
341
+ c. For the avoidance of doubt, the Licensor may also offer the
342
+ Licensed Material under separate terms or conditions or stop
343
+ distributing the Licensed Material at any time; however, doing so
344
+ will not terminate this Public License.
345
+
346
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
347
+ License.
348
+
349
+ Section 7 -- Other Terms and Conditions.
350
+
351
+ a. The Licensor shall not be bound by any additional or different
352
+ terms or conditions communicated by You unless expressly agreed.
353
+
354
+ b. Any arrangements, understandings, or agreements regarding the
355
+ Licensed Material not stated herein are separate from and
356
+ independent of the terms and conditions of this Public License.
357
+
358
+ Section 8 -- Interpretation.
359
+
360
+ a. For the avoidance of doubt, this Public License does not, and
361
+ shall not be interpreted to, reduce, limit, restrict, or impose
362
+ conditions on any use of the Licensed Material that could lawfully
363
+ be made without permission under this Public License.
364
+
365
+ b. To the extent possible, if any provision of this Public License is
366
+ deemed unenforceable, it shall be automatically reformed to the
367
+ minimum extent necessary to make it enforceable. If the provision
368
+ cannot be reformed, it shall be severed from this Public License
369
+ without affecting the enforceability of the remaining terms and
370
+ conditions.
371
+
372
+ c. No term or condition of this Public License will be waived and no
373
+ failure to comply consented to unless expressly agreed to by the
374
+ Licensor.
375
+
376
+ d. Nothing in this Public License constitutes or may be interpreted
377
+ as a limitation upon, or waiver of, any privileges and immunities
378
+ that apply to the Licensor or You, including from the legal
379
+ processes of any jurisdiction or authority.
380
+
381
+ =======================================================================
382
+
383
+ Creative Commons is not a party to its public
384
+ licenses. Notwithstanding, Creative Commons may elect to apply one of
385
+ its public licenses to material it publishes and in those instances
386
+ will be considered the β€œLicensor.” The text of the Creative Commons
387
+ public licenses is dedicated to the public domain under the CC0 Public
388
+ Domain Dedication. Except for the limited purpose of indicating that
389
+ material is shared under a Creative Commons public license or as
390
+ otherwise permitted by the Creative Commons policies published at
391
+ creativecommons.org/policies, Creative Commons does not authorize the
392
+ use of the trademark "Creative Commons" or any other trademark or logo
393
+ of Creative Commons without its prior written consent including,
394
+ without limitation, in connection with any unauthorized modifications
395
+ to any of its public licenses or any other arrangements,
396
+ understandings, or agreements concerning use of licensed material. For
397
+ the avoidance of doubt, this paragraph does not form part of the
398
+ public licenses.
399
+
400
+ Creative Commons may be contacted at creativecommons.org.
README.md CHANGED
@@ -1,3 +1,298 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MARLIN: Masked Autoencoder for facial video Representation LearnINg
2
+
3
+ <div>
4
+ <img src="assets/teaser.svg">
5
+ <p></p>
6
+ </div>
7
+
8
+ <div align="center">
9
+ <a href="https://github.com/ControlNet/MARLIN/network/members">
10
+ <img src="https://img.shields.io/github/forks/ControlNet/MARLIN?style=flat-square">
11
+ </a>
12
+ <a href="https://github.com/ControlNet/MARLIN/stargazers">
13
+ <img src="https://img.shields.io/github/stars/ControlNet/MARLIN?style=flat-square">
14
+ </a>
15
+ <a href="https://github.com/ControlNet/MARLIN/issues">
16
+ <img src="https://img.shields.io/github/issues/ControlNet/MARLIN?style=flat-square">
17
+ </a>
18
+ <a href="https://github.com/ControlNet/MARLIN/blob/master/LICENSE">
19
+ <img src="https://img.shields.io/badge/license-CC%20BY--NC%204.0-97ca00?style=flat-square">
20
+ </a>
21
+ <a href="https://arxiv.org/abs/2211.06627">
22
+ <img src="https://img.shields.io/badge/arXiv-2211.06627-b31b1b.svg?style=flat-square">
23
+ </a>
24
+ </div>
25
+
26
+ <div align="center">
27
+ <a href="https://pypi.org/project/marlin-pytorch/">
28
+ <img src="https://img.shields.io/pypi/v/marlin-pytorch?style=flat-square">
29
+ </a>
30
+ <a href="https://pypi.org/project/marlin-pytorch/">
31
+ <img src="https://img.shields.io/pypi/dm/marlin-pytorch?style=flat-square">
32
+ </a>
33
+ <a href="https://www.python.org/"><img src="https://img.shields.io/pypi/pyversions/marlin-pytorch?style=flat-square"></a>
34
+ <a href="https://pytorch.org/"><img src="https://img.shields.io/badge/PyTorch-%3E%3D1.8.0-EE4C2C?style=flat-square&logo=pytorch"></a>
35
+ </div>
36
+
37
+ <div align="center">
38
+ <a href="https://github.com/ControlNet/MARLIN/actions"><img src="https://img.shields.io/github/actions/workflow/status/ControlNet/MARLIN/unittest.yaml?branch=dev&label=unittest&style=flat-square"></a>
39
+ <a href="https://github.com/ControlNet/MARLIN/actions"><img src="https://img.shields.io/github/actions/workflow/status/ControlNet/MARLIN/release.yaml?branch=master&label=release&style=flat-square"></a>
40
+ <a href="https://coveralls.io/github/ControlNet/MARLIN"><img src="https://img.shields.io/coverallsCoverage/github/ControlNet/MARLIN?style=flat-square"></a>
41
+ </div>
42
+
43
+ This repo is the official PyTorch implementation for the paper
44
+ [MARLIN: Masked Autoencoder for facial video Representation LearnINg](https://openaccess.thecvf.com/content/CVPR2023/html/Cai_MARLIN_Masked_Autoencoder_for_Facial_Video_Representation_LearnINg_CVPR_2023_paper) (CVPR 2023).
45
+
46
+ ## Repository Structure
47
+
48
+ The repository contains 2 parts:
49
+ - `marlin-pytorch`: The PyPI package for MARLIN used for inference.
50
+ - The implementation for the paper including training and evaluation scripts.
51
+
52
+ ```
53
+ .
54
+ β”œβ”€β”€ assets # Images for README.md
55
+ β”œβ”€β”€ LICENSE
56
+ β”œβ”€β”€ README.md
57
+ β”œβ”€β”€ MODEL_ZOO.md
58
+ β”œβ”€β”€ CITATION.cff
59
+ β”œβ”€β”€ .gitignore
60
+ β”œβ”€β”€ .github
61
+
62
+ # below is for the PyPI package marlin-pytorch
63
+ β”œβ”€β”€ src # Source code for marlin-pytorch
64
+ β”œβ”€β”€ tests # Unittest
65
+ β”œβ”€β”€ requirements.lib.txt
66
+ β”œβ”€β”€ setup.py
67
+ β”œβ”€β”€ init.py
68
+ β”œβ”€β”€ version.txt
69
+
70
+ # below is for the paper implementation
71
+ β”œβ”€β”€ configs # Configs for experiments settings
72
+ β”œβ”€β”€ model # Marlin models
73
+ β”œβ”€β”€ preprocess # Preprocessing scripts
74
+ β”œβ”€β”€ dataset # Dataloaders
75
+ β”œβ”€β”€ utils # Utility functions
76
+ β”œβ”€β”€ train.py # Training script
77
+ β”œβ”€β”€ evaluate.py # Evaluation script
78
+ β”œβ”€β”€ requirements.txt
79
+
80
+ ```
81
+
82
+ ## Use `marlin-pytorch` for Feature Extraction
83
+
84
+ Requirements:
85
+ - Python >= 3.6, < 3.12
86
+ - PyTorch >= 1.8
87
+ - ffmpeg
88
+
89
+
90
+ Install from PyPI:
91
+ ```bash
92
+ pip install marlin-pytorch
93
+ ```
94
+
95
+ Load MARLIN model from online
96
+ ```python
97
+ from marlin_pytorch import Marlin
98
+ # Load MARLIN model from GitHub Release
99
+ model = Marlin.from_online("marlin_vit_base_ytf")
100
+ ```
101
+
102
+ Load MARLIN model from file
103
+ ```python
104
+ from marlin_pytorch import Marlin
105
+ # Load MARLIN model from local file
106
+ model = Marlin.from_file("marlin_vit_base_ytf", "path/to/marlin.pt")
107
+ # Load MARLIN model from the ckpt file trained by the scripts in this repo
108
+ model = Marlin.from_file("marlin_vit_base_ytf", "path/to/marlin.ckpt")
109
+ ```
110
+
111
+ Current model name list:
112
+ - `marlin_vit_small_ytf`: ViT-small encoder trained on YTF dataset. Embedding 384 dim.
113
+ - `marlin_vit_base_ytf`: ViT-base encoder trained on YTF dataset. Embedding 768 dim.
114
+ - `marlin_vit_large_ytf`: ViT-large encoder trained on YTF dataset. Embedding 1024 dim.
115
+
116
+ For more details, see [MODEL_ZOO.md](MODEL_ZOO.md).
117
+
118
+ When MARLIN model is retrieved from GitHub Release, it will be cached in `.marlin`. You can remove marlin cache by
119
+ ```python
120
+ from marlin_pytorch import Marlin
121
+ Marlin.clean_cache()
122
+ ```
123
+
124
+ Extract features from cropped video file
125
+ ```python
126
+ # Extract features from facial cropped video with size (224x224)
127
+ features = model.extract_video("path/to/video.mp4")
128
+ print(features.shape) # torch.Size([T, 768]) where T is the number of windows
129
+
130
+ # You can keep output of all elements from the sequence by setting keep_seq=True
131
+ features = model.extract_video("path/to/video.mp4", keep_seq=True)
132
+ print(features.shape) # torch.Size([T, k, 768]) where k = T/t * H/h * W/w = 8 * 14 * 14 = 1568
133
+ ```
134
+
135
+ Extract features from in-the-wild video file
136
+ ```python
137
+ # Extract features from in-the-wild video with various size
138
+ features = model.extract_video("path/to/video.mp4", crop_face=True)
139
+ print(features.shape) # torch.Size([T, 768])
140
+ ```
141
+
142
+ Extract features from video clip tensor
143
+ ```python
144
+ # Extract features from clip tensor with size (B, 3, 16, 224, 224)
145
+ x = ... # video clip
146
+ features = model.extract_features(x) # torch.Size([B, k, 768])
147
+ features = model.extract_features(x, keep_seq=False) # torch.Size([B, 768])
148
+ ```
149
+
150
+ ## Paper Implementation
151
+
152
+ ### Requirements
153
+ - Python >= 3.7, < 3.12
154
+ - PyTorch ~= 1.11
155
+ - Torchvision ~= 0.12
156
+
157
+ ### Installation
158
+
159
+ Firstly, make sure you have installed PyTorch and Torchvision with or without CUDA.
160
+
161
+ Clone the repo and install the requirements:
162
+ ```bash
163
+ git clone https://github.com/ControlNet/MARLIN.git
164
+ cd MARLIN
165
+ pip install -r requirements.txt
166
+ ```
167
+
168
+ ### MARLIN Pretraining
169
+
170
+ Download the [YoutubeFaces](https://www.cs.tau.ac.il/~wolf/ytfaces/) dataset (only `frame_images_DB` is required).
171
+
172
+ Download the face parsing model from [face_parsing.farl.lapa](https://github.com/FacePerceiver/facer/releases/download/models-v1/face_parsing.farl.lapa.main_ema_136500_jit191.pt)
173
+ and put it in `utils/face_sdk/models/face_parsing/face_parsing_1.0`.
174
+
175
+ Download the VideoMAE pretrained [checkpoint](https://github.com/ControlNet/MARLIN/releases/misc)
176
+ for initializing the weights. (ps. They updated their models in this
177
+ [commit](https://github.com/MCG-NJU/VideoMAE/commit/2b56a75d166c619f71019e3d1bb1c4aedafe7a90), but we are using the
178
+ old models which are not shared anymore by the authors. So we uploaded this model by ourselves.)
179
+
180
+ Then run scripts to process the dataset:
181
+ ```bash
182
+ python preprocess/ytf_preprocess.py --data_dir /path/to/youtube_faces --max_workers 8
183
+ ```
184
+ After processing, the directory structure should be like this:
185
+ ```
186
+ β”œβ”€β”€ YoutubeFaces
187
+ β”‚ β”œβ”€β”€ frame_images_DB
188
+ β”‚ β”‚ β”œβ”€β”€ Aaron_Eckhart
189
+ β”‚ β”‚ β”‚ β”œβ”€β”€ 0
190
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ 0.555.jpg
191
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ ...
192
+ β”‚ β”‚ β”‚ β”œβ”€β”€ ...
193
+ β”‚ β”‚ β”œβ”€β”€ ...
194
+ β”‚ β”œβ”€β”€ crop_images_DB
195
+ β”‚ β”‚ β”œβ”€β”€ Aaron_Eckhart
196
+ β”‚ β”‚ β”‚ β”œβ”€β”€ 0
197
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ 0.555.jpg
198
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ ...
199
+ β”‚ β”‚ β”‚ β”œβ”€β”€ ...
200
+ β”‚ β”‚ β”œβ”€β”€ ...
201
+ β”‚ β”œβ”€β”€ face_parsing_images_DB
202
+ β”‚ β”‚ β”œβ”€β”€ Aaron_Eckhart
203
+ β”‚ β”‚ β”‚ β”œβ”€β”€ 0
204
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ 0.555.npy
205
+ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ ...
206
+ β”‚ β”‚ β”‚ β”œβ”€β”€ ...
207
+ β”‚ β”‚ β”œβ”€β”€ ...
208
+ β”‚ β”œβ”€β”€ train_set.csv
209
+ β”‚ β”œβ”€β”€ val_set.csv
210
+ ```
211
+
212
+ Then, run the training script:
213
+ ```bash
214
+ python train.py \
215
+ --config config/pretrain/marlin_vit_base.yaml \
216
+ --data_dir /path/to/youtube_faces \
217
+ --n_gpus 4 \
218
+ --num_workers 8 \
219
+ --batch_size 16 \
220
+ --epochs 2000 \
221
+ --official_pretrained /path/to/videomae/checkpoint.pth
222
+ ```
223
+
224
+ After trained, you can load the checkpoint for inference by
225
+
226
+ ```python
227
+ from marlin_pytorch import Marlin
228
+ from marlin_pytorch.config import register_model_from_yaml
229
+
230
+ register_model_from_yaml("my_marlin_model", "path/to/config.yaml")
231
+ model = Marlin.from_file("my_marlin_model", "path/to/marlin.ckpt")
232
+ ```
233
+
234
+ ## Evaluation
235
+
236
+ <details>
237
+ <summary>CelebV-HQ</summary>
238
+
239
+ #### 1. Download the dataset
240
+ Download dataset from [CelebV-HQ](https://github.com/CelebV-HQ/CelebV-HQ) and the file structure should be like this:
241
+ ```
242
+ β”œβ”€β”€ CelebV-HQ
243
+ β”‚ β”œβ”€β”€ downloaded
244
+ β”‚ β”‚ β”œβ”€β”€ ***.mp4
245
+ β”‚ β”‚ β”œβ”€β”€ ...
246
+ β”‚ β”œβ”€β”€ celebvhq_info.json
247
+ β”‚ β”œβ”€β”€ ...
248
+ ```
249
+ #### 2. Preprocess the dataset
250
+ Crop the face region from the raw video and split the train val and test sets.
251
+ ```bash
252
+ python preprocess/celebvhq_preprocess.py --data_dir /path/to/CelebV-HQ
253
+ ```
254
+
255
+ #### 3. Extract MARLIN features (Optional, if linear probing)
256
+ Extract MARLIN features from the cropped video and saved to `<backbone>` directory in `CelebV-HQ` directory.
257
+ ```bash
258
+ python preprocess/celebvhq_extract.py --data_dir /path/to/CelebV-HQ --backbone marlin_vit_base_ytf
259
+ ```
260
+
261
+ #### 4. Train and evaluate
262
+ Train and evaluate the model adapted from MARLIN to CelebV-HQ.
263
+
264
+ Please use the configs in `config/celebv_hq/*/*.yaml` as the config file.
265
+ ```bash
266
+ python evaluate.py \
267
+ --config /path/to/config \
268
+ --data_path /path/to/CelebV-HQ
269
+ --num_workers 4
270
+ --batch_size 16
271
+ ```
272
+
273
+ </details>
274
+
275
+
276
+ ## License
277
+
278
+ This project is under the CC BY-NC 4.0 license. See [LICENSE](LICENSE) for details.
279
+
280
+ ## References
281
+ If you find this work useful for your research, please consider citing it.
282
+ ```bibtex
283
+ @inproceedings{cai2022marlin,
284
+ title = {MARLIN: Masked Autoencoder for facial video Representation LearnINg},
285
+ author = {Cai, Zhixi and Ghosh, Shreya and Stefanov, Kalin and Dhall, Abhinav and Cai, Jianfei and Rezatofighi, Hamid and Haffari, Reza and Hayat, Munawar},
286
+ booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
287
+ year = {2023},
288
+ month = {June},
289
+ pages = {1493-1504},
290
+ doi = {10.1109/CVPR52729.2023.00150},
291
+ publisher = {IEEE},
292
+ }
293
+ ```
294
+
295
+ ## Acknowledgements
296
+
297
+ Some code about model is based on [MCG-NJU/VideoMAE](https://github.com/MCG-NJU/VideoMAE). The code related to preprocessing
298
+ is borrowed from [JDAI-CV/FaceX-Zoo](https://github.com/JDAI-CV/FaceX-Zoo).
marlin_vit_base_ytf.encoder.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:407ce10754c9c088eff569a652c5938fc634866771d82650a2412a950810fcde
3
+ size 349787903
marlin_vit_base_ytf.full.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ae29a35f7fc0a82aefdbb1dd1fe071c37b64951ad2bcb6c9625ee95b9e8550b
3
+ size 384149513
marlin_vit_large_ytf.encoder.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1201cbe972cdf3e238a1ef8b93fed9fc9825b90f89bd3939e0e29376770ff4c3
3
+ size 1221962759
marlin_vit_large_ytf.full.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:540a5ba21a2f5bb46b9da6780f740b760f5d1b49c6742bf1c8426a5fc08389b9
3
+ size 1381769537
marlin_vit_small_ytf.encoder.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50fe50bfb1e1afbcccd2660f8267ac27469dabd8c9774159abc4772c1a1ac2d8
3
+ size 89977023
marlin_vit_small_ytf.full.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64791f6451583670bea854e78c345ae0e06b9938b72bc43bd757bb14e7736e4d
3
+ size 99797129