-
-
Save sazio/e64cd4cb433c5a4dc1cb6912577fb568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Preview Fake/Real (this one is obvious) | |
idx = 21 # 27 # 21 # 19 # 12 # 6 | |
fake = train_pd["filename"][idx] | |
real = train_pd["original"][idx] | |
vid_width = train_pd["video_width"][idx] | |
vid_real = open(VIDEOS_FOLDER_TRAIN + "/" + real, 'rb').read() | |
data_url_real = "data:video/mp4;base64," + b64encode(vid_real).decode() | |
vid_fake = open(VIDEOS_FOLDER_TRAIN + "/" + fake, 'rb').read() | |
data_url_fake = "data:video/mp4;base64," + b64encode(vid_fake).decode() | |
HTML(""" | |
<div style='width: 100%%; display: table;'> | |
<div style='display: table-row'> | |
<div style='width: %dpx; display: table-cell;'><b>Real</b>: %s<br/><video width=%d controls><source src="%s" type="video/mp4"></video></div> | |
<div style='display: table-cell;'><b>Fake</b>: %s<br/><video width=%d controls><source src="%s" type="video/mp4"></video></div> | |
</div> | |
</div> | |
""" % ( int(vid_width/3.2) + 10, | |
real, int(vid_width/3.2), data_url_real, | |
fake, int(vid_width/3.2), data_url_fake)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment