Skip to content

Commit 962e4d4

Browse files
committed
fix: remove scenemodels
1 parent b168054 commit 962e4d4

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

videodb/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from videodb._constants import (
99
VIDEO_DB_API,
1010
MediaType,
11-
SceneModels,
1211
SearchType,
1312
SubtitleAlignment,
1413
SubtitleBorderStyle,
@@ -38,7 +37,6 @@
3837
"SubtitleAlignment",
3938
"SubtitleBorderStyle",
4039
"SubtitleStyle",
41-
"SceneModels",
4240
]
4341

4442

videodb/_constants.py

-6
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ class IndexType:
2222
scene = "scene"
2323

2424

25-
class SceneModels:
26-
gemini_vision: str = "gemini-vision"
27-
gpt4_vision: str = "gpt4-v"
28-
all: str = "all"
29-
30-
3125
class Workflows:
3226
add_subtitles = "add_subtitles"
3327

videodb/_utils/_http_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _get_output(self, url: str):
133133
response_json.get("status") == Status.in_progress
134134
or response_json.get("status") == Status.processing
135135
):
136-
percentage = response_json.get("data").get("percentage")
136+
percentage = response_json.get("data", {}).get("percentage")
137137
if percentage and self.show_progress and self.progress_bar:
138138
self.progress_bar.n = int(percentage)
139139
self.progress_bar.update(0)
@@ -169,7 +169,7 @@ def _parse_response(self, response: requests.Response):
169169
bar_format="{l_bar}{bar:100}{r_bar}{bar:-100b}",
170170
)
171171
response_json = self._get_output(
172-
response_json.get("data").get("output_url")
172+
response_json.get("data", {}).get("output_url")
173173
)
174174
if response_json.get("success"):
175175
return response_json.get("data")

videodb/search.py

-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ def search_inside_video(
186186
self,
187187
video_id: str,
188188
query: str,
189-
scene_model: Optional[str] = None,
190189
result_threshold: Optional[int] = None,
191190
score_threshold: Optional[int] = None,
192191
dynamic_score_percentage: Optional[int] = None,
@@ -197,7 +196,6 @@ def search_inside_video(
197196
data={
198197
"index_type": SearchType.scene,
199198
"query": query,
200-
"model_name": scene_model,
201199
"score_threshold": score_threshold,
202200
"result_threshold": result_threshold,
203201
},

videodb/video.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from videodb._constants import (
44
ApiPath,
55
IndexType,
6-
SceneModels,
76
SearchType,
87
SubtitleStyle,
98
Workflows,
@@ -47,7 +46,6 @@ def search(
4746
self,
4847
query: str,
4948
search_type: Optional[str] = SearchType.semantic,
50-
scene_model: Optional[str] = SceneModels.gemini_vision,
5149
result_threshold: Optional[int] = None,
5250
score_threshold: Optional[int] = None,
5351
dynamic_score_percentage: Optional[int] = None,
@@ -59,7 +57,6 @@ def search(
5957
result_threshold=result_threshold,
6058
score_threshold=score_threshold,
6159
dynamic_score_percentage=dynamic_score_percentage,
62-
scene_model=scene_model,
6360
)
6461

6562
def delete(self) -> None:
@@ -136,7 +133,6 @@ def index_spoken_words(self) -> None:
136133

137134
def index_scenes(
138135
self,
139-
scene_model: str = SceneModels.gemini_vision,
140136
force: bool = False,
141137
prompt: str = None,
142138
callback_url: str = None,
@@ -145,34 +141,29 @@ def index_scenes(
145141
path=f"{ApiPath.video}/{self.id}/{ApiPath.index}",
146142
data={
147143
"index_type": IndexType.scene,
148-
"model_name": scene_model,
149144
"force": force,
150145
"prompt": prompt,
151146
"callback_url": callback_url,
152147
},
153148
)
154149

155-
def get_scenes(
156-
self, scene_model: str = SceneModels.gemini_vision
157-
) -> Union[list, None]:
150+
def get_scenes(self) -> Union[list, None]:
158151
if self.scenes:
159152
return self.scenes
160153
scene_data = self._connection.get(
161154
path=f"{ApiPath.video}/{self.id}/{ApiPath.index}",
162155
params={
163156
"index_type": IndexType.scene,
164-
"model_name": scene_model,
165157
},
166158
)
167159
self.scenes = scene_data
168160
return scene_data if scene_data else None
169161

170-
def delete_scene_index(self, scene_model: str = SceneModels.gemini_vision) -> None:
162+
def delete_scene_index(self) -> None:
171163
self._connection.post(
172164
path=f"{ApiPath.video}/{self.id}/{ApiPath.index}/{ApiPath.delete}",
173165
data={
174166
"index_type": IndexType.scene,
175-
"model_name": scene_model,
176167
},
177168
)
178169
self.scenes = None

0 commit comments

Comments
 (0)