juanpablomesa
commited on
Commit
·
c45d9fe
1
Parent(s):
cbcc67d
Removed troch.stack()
Browse files- handler.py +3 -3
handler.py
CHANGED
@@ -111,12 +111,12 @@ class EndpointHandler:
|
|
111 |
frame_embedding = self.model.get_video_features(**frame_preprocessed)
|
112 |
|
113 |
# Stack the list of frame embeddings into a single tensor
|
114 |
-
self.logger.info("Stacking embeddings into a single tensor.")
|
115 |
-
tensor = torch.stack(frame_embedding)
|
116 |
|
117 |
# detach text emb from graph, move to CPU, and convert to numpy array
|
118 |
self.logger.info("Squeezing tensor")
|
119 |
-
batch_emb =
|
120 |
|
121 |
self.logger.info("Converting into numpy array")
|
122 |
batch_emb = batch_emb.cpu().detach().numpy()
|
|
|
111 |
frame_embedding = self.model.get_video_features(**frame_preprocessed)
|
112 |
|
113 |
# Stack the list of frame embeddings into a single tensor
|
114 |
+
# self.logger.info("Stacking embeddings into a single tensor.")
|
115 |
+
# tensor = torch.stack(frame_embedding)
|
116 |
|
117 |
# detach text emb from graph, move to CPU, and convert to numpy array
|
118 |
self.logger.info("Squeezing tensor")
|
119 |
+
batch_emb = frame_embedding.squeeze(0)
|
120 |
|
121 |
self.logger.info("Converting into numpy array")
|
122 |
batch_emb = batch_emb.cpu().detach().numpy()
|