Commit ·
83cd9c3
1
Parent(s): 41bc78a
Added back some logging messages
Browse files- handler.py +3 -3
handler.py
CHANGED
|
@@ -140,14 +140,14 @@ class EndpointHandler:
|
|
| 140 |
frame_embedding = self.model.get_video_features(**frame_preprocessed)
|
| 141 |
|
| 142 |
# Check the shape of the tensor
|
| 143 |
-
|
| 144 |
|
| 145 |
# Normalize the embeddings if it's a 2D tensor
|
| 146 |
if frame_embedding.dim() == 2:
|
| 147 |
-
|
| 148 |
batch_emb = torch.nn.functional.normalize(frame_embedding, p=2, dim=1)
|
| 149 |
else:
|
| 150 |
-
|
| 151 |
batch_emb = frame_embedding.squeeze(0)
|
| 152 |
|
| 153 |
self.logger.info("Converting into numpy array")
|
|
|
|
| 140 |
frame_embedding = self.model.get_video_features(**frame_preprocessed)
|
| 141 |
|
| 142 |
# Check the shape of the tensor
|
| 143 |
+
self.logger.info(f"Shape of the batch_emb tensor: {frame_embedding.shape}")
|
| 144 |
|
| 145 |
# Normalize the embeddings if it's a 2D tensor
|
| 146 |
if frame_embedding.dim() == 2:
|
| 147 |
+
self.logger.info("Normalizing embeddings")
|
| 148 |
batch_emb = torch.nn.functional.normalize(frame_embedding, p=2, dim=1)
|
| 149 |
else:
|
| 150 |
+
self.logger.info("Skipping normalization due to tensor shape")
|
| 151 |
batch_emb = frame_embedding.squeeze(0)
|
| 152 |
|
| 153 |
self.logger.info("Converting into numpy array")
|