Spaces:
Sleeping
Sleeping
sindhuhegde
commited on
Commit
•
90e5b39
1
Parent(s):
54b0fbe
Update app
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ CHECKPOINT_PATH = "model_rgb.pth"
|
|
41 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
42 |
use_cuda = torch.cuda.is_available()
|
43 |
print("Use cuda status: ", use_cuda)
|
44 |
-
batch_size =
|
45 |
fps = 25
|
46 |
n_negative_samples = 100
|
47 |
|
@@ -1083,11 +1083,12 @@ def get_embeddings(video_sequences, audio_sequences, model, calc_aud_emb=True):
|
|
1083 |
- audio_emb (array) : Audio embedding
|
1084 |
'''
|
1085 |
|
1086 |
-
batch_size = 48
|
1087 |
video_emb = []
|
1088 |
audio_emb = []
|
1089 |
|
1090 |
-
|
|
|
|
|
1091 |
video_inp = video_sequences[i:i+batch_size, ]
|
1092 |
vid_emb = model.forward_vid(video_inp.to(device), return_feats=False)
|
1093 |
vid_emb = torch.mean(vid_emb, axis=-1)
|
|
|
41 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
42 |
use_cuda = torch.cuda.is_available()
|
43 |
print("Use cuda status: ", use_cuda)
|
44 |
+
batch_size = 48
|
45 |
fps = 25
|
46 |
n_negative_samples = 100
|
47 |
|
|
|
1083 |
- audio_emb (array) : Audio embedding
|
1084 |
'''
|
1085 |
|
|
|
1086 |
video_emb = []
|
1087 |
audio_emb = []
|
1088 |
|
1089 |
+
model = model.cuda()
|
1090 |
+
|
1091 |
+
for i in tqdm(range(0, len(video_sequences), batch_size)):
|
1092 |
video_inp = video_sequences[i:i+batch_size, ]
|
1093 |
vid_emb = model.forward_vid(video_inp.to(device), return_feats=False)
|
1094 |
vid_emb = torch.mean(vid_emb, axis=-1)
|