Skip to content

Commit

Permalink
test: fixing video es vec
Browse files Browse the repository at this point in the history
  • Loading branch information
aatmanvaidya committed Mar 5, 2024
1 parent 5959f74 commit bf7dede
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tests/core/store/test_video_es_vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from core.store.es_vec import ES
from core.config import StoreConfig, StoreParameters
from core.models.media import MediaType
from core.models.media_factory import VideoFactory
from core.operators import vid_vec_rep_resnet
from datetime import datetime

Expand Down Expand Up @@ -73,7 +74,8 @@ def test_1_store_video_vector(self):
# generate video embedding
vid_vec_rep_resnet.initialize(param=None)
file_name = "sample-cat-video.mp4"
video = {"path": r"core/operators/sample_data/sample-cat-video.mp4"}
video_url = "https://raw.githubusercontent.com/tattle-made/feluda/main/src/core/operators/sample_data/sample-cat-video.mp4"
video = VideoFactory.make_from_url(video_url)
embedding = vid_vec_rep_resnet.run(video)
doc = self.generate_document(file_name, embedding)

Expand All @@ -92,7 +94,8 @@ def test_2_search_video_vector(self):
# generate video embedding
vid_vec_rep_resnet.initialize(param=None)
file_name = "sample-cat-video.mp4"
video = {"path": r"core/operators/sample_data/sample-cat-video.mp4"}
video_url = "https://raw.githubusercontent.com/tattle-made/feluda/main/src/core/operators/sample_data/sample-cat-video.mp4"
video = VideoFactory.make_from_url(video_url)
embedding = vid_vec_rep_resnet.run(video)
average_vector = next(embedding)
search_result = es.find("video", average_vector.get('vid_vec'))
Expand Down

0 comments on commit bf7dede

Please sign in to comment.