Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
awkrail committed Sep 18, 2024
1 parent 7bda000 commit b31a6f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lighthouse/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ def _post_processing(
pred_spans = torch.clamp(span_cxw_to_xx(pred_spans) * video_duration, min=0, max=video_duration)
cur_ranked_preds = torch.cat([pred_spans, scores[:, None]], dim=1).tolist()
cur_ranked_preds = sorted(cur_ranked_preds, key=lambda x: x[2], reverse=True)
cur_ranked_preds = [[float(f"{e:.4f}") for e in row] for row in cur_ranked_preds][:self._moment_num]
cur_ranked_preds = [[float(f"{e:.4f}") for e in row] for row in cur_ranked_preds]
saliency_scores = outputs["saliency_scores"][inputs["src_vid_mask"] == 1].cpu().tolist()

return cur_ranked_preds, saliency_scores
return cur_ranked_preds[:self._moment_num], saliency_scores

def _encode_audio(
self,
Expand Down

0 comments on commit b31a6f5

Please sign in to comment.