Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,21 +44,21 @@ HTML="""
|
|
| 44 |
"""
|
| 45 |
|
| 46 |
DESCRIPTION="""Welcome to our video retrieval demo powered by [Searchium-ai/clip4clip-webvid150k](https://huggingface.co/Searchium-ai/clip4clip-webvid150k)! <br>
|
| 47 |
-
Using free text search - you will find the top 5 most relevant clips among a dataset of
|
| 48 |
Discover, explore, and enjoy the world of video search at your fingertips.
|
| 49 |
"""
|
| 50 |
ENDING = """For search acceleration capabilities, please refer to [Searchium.ai](https://www.searchium.ai)
|
| 51 |
"""
|
| 52 |
|
| 53 |
|
| 54 |
-
DATA_PATH = './
|
| 55 |
|
| 56 |
-
ft_visual_features_file = DATA_PATH + '/
|
| 57 |
|
| 58 |
#load database features:
|
| 59 |
ft_visual_features_database = np.load(ft_visual_features_file)
|
| 60 |
|
| 61 |
-
database_csv_path = os.path.join(DATA_PATH, '
|
| 62 |
database_df = pd.read_csv(database_csv_path)
|
| 63 |
|
| 64 |
class NearestNeighbors:
|
|
@@ -115,6 +115,7 @@ class NearestNeighbors:
|
|
| 115 |
|
| 116 |
model = CLIPTextModelWithProjection.from_pretrained("Searchium-ai/clip4clip-webvid150k")
|
| 117 |
tokenizer = CLIPTokenizer.from_pretrained("Searchium-ai/clip4clip-webvid150k")
|
|
|
|
| 118 |
nn_search = NearestNeighbors(n_neighbors=5, metric='binary', rerank_from=100)
|
| 119 |
nn_search.fit(np.packbits((ft_visual_features_database > 0.0).astype(bool), axis=1), o_data=ft_visual_features_database)
|
| 120 |
|
|
|
|
| 44 |
"""
|
| 45 |
|
| 46 |
DESCRIPTION="""Welcome to our video retrieval demo powered by [Searchium-ai/clip4clip-webvid150k](https://huggingface.co/Searchium-ai/clip4clip-webvid150k)! <br>
|
| 47 |
+
Using free text search - you will find the top 5 most relevant clips among a dataset of 5.5 million video clips. <br>
|
| 48 |
Discover, explore, and enjoy the world of video search at your fingertips.
|
| 49 |
"""
|
| 50 |
ENDING = """For search acceleration capabilities, please refer to [Searchium.ai](https://www.searchium.ai)
|
| 51 |
"""
|
| 52 |
|
| 53 |
|
| 54 |
+
DATA_PATH = './new_data'
|
| 55 |
|
| 56 |
+
ft_visual_features_file = DATA_PATH + '/video_dataset_visual_features_database.npy'
|
| 57 |
|
| 58 |
#load database features:
|
| 59 |
ft_visual_features_database = np.load(ft_visual_features_file)
|
| 60 |
|
| 61 |
+
database_csv_path = os.path.join(DATA_PATH, 'half_video_dataset.csv')
|
| 62 |
database_df = pd.read_csv(database_csv_path)
|
| 63 |
|
| 64 |
class NearestNeighbors:
|
|
|
|
| 115 |
|
| 116 |
model = CLIPTextModelWithProjection.from_pretrained("Searchium-ai/clip4clip-webvid150k")
|
| 117 |
tokenizer = CLIPTokenizer.from_pretrained("Searchium-ai/clip4clip-webvid150k")
|
| 118 |
+
|
| 119 |
nn_search = NearestNeighbors(n_neighbors=5, metric='binary', rerank_from=100)
|
| 120 |
nn_search.fit(np.packbits((ft_visual_features_database > 0.0).astype(bool), axis=1), o_data=ft_visual_features_database)
|
| 121 |
|