from util import embed_scores as ES

query_vector = ES.get_query_vector('A cat grooming their tail')
c_dir = '/srv/ftp_tcc/leopards1/2026/02/28'

vpath = '/srv/ftp_tcc/leopards2/2026/02/28/Leopards2_00_20260228210054.mp4'
from CommonCode.video_meta import FTPVideo
#vec_rep = ES.get_vector_representation('/srv/ftp_tcc/leopards2/2026/02/28')
#if isinstance(vec_rep['embeds'], dict):
#    vec_rep['embeds'] = [y for x,y in vec_rep['embeds'].items()]
# %%
vec_rep = ES.get_vector_representation(c_dir)
vec_rep['idces'].shape
sum([x.shape[-2] for _,x in vec_rep['embeds'].items()])
# %%
#ou = ES.calculate_embedding_score_in_folder(
ou = ES.calculate_embedding_score_in_folder(c_dir, threshold=0.04, query = 'A cat grooming')
# %%
vec_rep, query_scores = ES.get_scores_embedding_c_dir(c_dir, query_vector.squeeze())

# results = ES.get_clip_scores(video_path, prompt)
# %%


import pickle
with open('/home/thebears/crap.p','rb') as ff:
    ou = pickle.load(ff)
