9
9
Workflows ,
10
10
)
11
11
from videodb .image import Image , Frame
12
- from videodb .scene import SceneExtractionConfig , Scene , SceneCollection
12
+ from videodb .scene import Scene , SceneCollection
13
13
from videodb .search import SearchFactory , SearchResult
14
14
from videodb .shot import Shot
15
15
@@ -213,25 +213,18 @@ def _format_scene_collection(self, collection_data: dict) -> SceneCollection:
213
213
)
214
214
scenes .append (scene )
215
215
216
- config = collection_data .get ("config" , {})
217
-
218
216
return SceneCollection (
219
217
self ._connection ,
220
218
collection_data .get ("scenes_collection_id" ),
221
219
self .id ,
222
- SceneExtractionConfig (
223
- config .get ("time" ),
224
- config .get ("threshold" ),
225
- config .get ("frame_count" ),
226
- config .get ("select_frame" ),
227
- ),
220
+ collection_data .get ("config" , {}),
228
221
scenes ,
229
222
)
230
223
231
224
def extract_scenes (
232
225
self ,
233
226
extraction_type : SceneExtractionType = SceneExtractionType .scene ,
234
- extraction_config : SceneExtractionConfig = SceneExtractionConfig () ,
227
+ extraction_config : dict = {} ,
235
228
force : bool = False ,
236
229
callback_url : str = None ,
237
230
):
@@ -240,7 +233,7 @@ def extract_scenes(
240
233
data = {
241
234
"index_type" : IndexType .scene ,
242
235
"extraction_type" : extraction_type ,
243
- "extraction_config" : extraction_config . __dict__ ,
236
+ "extraction_config" : extraction_config ,
244
237
"force" : force ,
245
238
"callback_url" : callback_url ,
246
239
},
@@ -267,7 +260,7 @@ def delete_scene_collection(self, collection_id: str) -> None:
267
260
def create_scene_index (
268
261
self ,
269
262
extraction_type : SceneExtractionType = SceneExtractionType .scene ,
270
- extraction_config : SceneExtractionConfig = SceneExtractionConfig () ,
263
+ extraction_config : dict = {} ,
271
264
scenes : List [Scene ] = [],
272
265
force : bool = False ,
273
266
callback_url : str = None ,
@@ -277,7 +270,7 @@ def create_scene_index(
277
270
data = {
278
271
"scenes" : [scene .to_json () for scene in scenes ],
279
272
"extraction_type" : extraction_type ,
280
- "extraction_config" : extraction_config . __dict__ ,
273
+ "extraction_config" : extraction_config ,
281
274
"force" : force ,
282
275
"callback_url" : callback_url ,
283
276
},
0 commit comments