INNER CODE UNIT · Python
_hash_list
patrickjohncyh/fashion-clip · fashion_clip/fashion_clip.py:84
def _hash_list(self, l: List[str]):
l_hash = map(lambda el: hashlib.sha256(str(el).encode()).hexdigest(), l)
l_hash = ' '.join(l_hash)
return hashlib.sha256(l_hash.encode()).hexdigest()
def hash(self):
id_hash = self._hash_list(self.ids)
images_hash = self._hash_list(self.images)
caption_hash = self._hash_list(self.captions)
return hashlib.sha256((id_hash+images_hash+caption_hash).encode()).hexdigest()
class FashionCLIP:
"""
FashionCLIP class takes:
1. FCLIPModel Name / Path
2. FCLIPDataset
Then, it generates required embeddings based on the dataset
OR if a pre-processed versions exists then pull it from S3?