mixpeek 0.8.1__py3-none-any.whl → 0.8.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,17 +6,19 @@ class Index:
6
6
  self.base_url = base_url
7
7
  self.headers = headers
8
8
 
9
- def _prepare_data(self, base_data, metadata=None, settings=None):
9
+ def _prepare_data(self, base_data, metadata=None, video_settings=None, image_settings=None):
10
10
  if metadata is not None:
11
11
  base_data["metadata"] = metadata
12
- if settings is not None:
13
- base_data["settings"] = settings
12
+ if video_settings is not None:
13
+ base_data["video_settings"] = video_settings
14
+ if image_settings is not None:
15
+ base_data["image_settings"] = image_settings
14
16
  return base_data
15
17
 
16
- def url(self, target_url, collection_id, metadata=None, settings=None):
18
+ def url(self, target_url, collection_id, metadata=None, video_settings=None, image_settings=None):
17
19
  try:
18
20
  endpoint = f"{self.base_url}index/url"
19
- data = self._prepare_data({"url": target_url, "collection_id": collection_id}, metadata, settings)
21
+ data = self._prepare_data({"url": target_url, "collection_id": collection_id}, metadata, video_settings, image_settings)
20
22
 
21
23
  response = requests.post(endpoint, json=data, headers=self.headers)
22
24
  response.raise_for_status()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mixpeek
3
- Version: 0.8.1
3
+ Version: 0.8.2
4
4
  Summary: Mixpeek Python SDK
5
5
  Home-page: https://github.com/mixpeek/mixpeek-python
6
6
  Author: Ethan Steininger
@@ -293,6 +293,58 @@ The `process` method returns a list of dictionaries, each containing:
293
293
 
294
294
  This tool is particularly useful when you need to embed long videos, as it allows you to process the video in smaller chunks and embed each chunk separately.
295
295
 
296
+ ### Register
297
+
298
+ The `register` module provides methods for registering various types of data, such as faces for facial recognition.
299
+
300
+ #### Face Registration
301
+
302
+ ```python
303
+ from mixpeek import Mixpeek
304
+
305
+ # Initialize the Mixpeek client
306
+ mixpeek = Mixpeek(api_key="your_api_key_here")
307
+
308
+ # Path to the local image file containing faces
309
+ face_image_path = "/path/to/your/face_image.jpg"
310
+
311
+ # Start the face registration task
312
+ task = mixpeek.register.faces(
313
+ file_path=face_image_path,
314
+ collection_id="face-recognition-collection",
315
+ metadata={"name": "John Doe", "age": 30},
316
+ settings={"detection_threshold": 0.8}
317
+ )
318
+
319
+ # Define a callback function (optional)
320
+ def on_task_update(status):
321
+ print(f"Current task status: {status}")
322
+
323
+ # Wait for the task to complete
324
+ status = task.wait_for_done(
325
+ sleep_interval=1,
326
+ callback=on_task_update
327
+ )
328
+
329
+ print(f"Face registration completed with status: {status}")
330
+
331
+ # If you want to do something with the final result
332
+ if status.get("status") == "DONE":
333
+ result = status.get("result")
334
+ print("Face registration result:", result)
335
+ else:
336
+ print("Face registration failed or was interrupted")
337
+ ```
338
+
339
+ Parameters for `mixpeek.register.faces`:
340
+
341
+ - `file_path` (str): Path to the local image file containing faces to register.
342
+ - `collection_id` (str): The ID of the collection to add the registered faces to.
343
+ - `metadata` (dict, optional): Additional metadata for the registered faces.
344
+ - `settings` (dict, optional): Processing settings for face registration.
345
+
346
+ The `faces` method returns a `Task` object that allows you to monitor the progress of the face registration process.
347
+
296
348
  ## Response Format
297
349
 
298
350
  All methods return a JSON response. In case of an error, the response will contain an "error" key with a description of the error.
@@ -4,12 +4,12 @@ mixpeek/exceptions.py,sha256=Orhdo5UFLn3fcWVJtlgkznW8Iy5ndL96h0qTY8zOlDA,235
4
4
  mixpeek/endpoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  mixpeek/endpoints/collections.py,sha256=-mxmI4Bs60OH6HRPzE03rr0XVnzqUxL_iHgF-_4R6Qc,3232
6
6
  mixpeek/endpoints/embed.py,sha256=ybDqyIt0oJiwIdH1QSwuV-CPeJgd-zW0etNAcBdgZYE,2290
7
- mixpeek/endpoints/index.py,sha256=kG5bf0ycIWvooicA5xowXrWH4x6nbzP6XdyK-XQHqU0,1976
7
+ mixpeek/endpoints/index.py,sha256=MGwhQSkJqstu-TtlefwwREhu7dfA5kYam2MD2B69Rbc,2166
8
8
  mixpeek/endpoints/register.py,sha256=ZVes4BPxQsPRNk70tGeVe_CYr4eVQKL-CTVmzpJAHM4,1314
9
9
  mixpeek/endpoints/search.py,sha256=u3onbss7Llx0AgcTSRtel6bGO5Ly3jvraXPcA26GzsY,2387
10
10
  mixpeek/endpoints/tasks.py,sha256=GBkscCYVv46JkJ4MVOtM6tL__rymnM3bmt4PrdRK04Y,839
11
11
  mixpeek/endpoints/tools.py,sha256=T8qb9zngY3V_vwtmBBrTqPvqZl1QIL8q3at3UGIj4bg,4709
12
- mixpeek-0.8.1.dist-info/METADATA,sha256=aCVFiT_BXaKmv-DydThZYI6HJhgpcaeg1NXnFwN-9vk,10616
13
- mixpeek-0.8.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
14
- mixpeek-0.8.1.dist-info/top_level.txt,sha256=EJ8Jc4IhqyUwnUlBwKbs498Ju4O9a-IDh2kXc_lo6Vg,8
15
- mixpeek-0.8.1.dist-info/RECORD,,
12
+ mixpeek-0.8.2.dist-info/METADATA,sha256=2g-yVma_tM5bb7WdQh6dyL9_YHgrB9XHw1eCQIdeKFs,12223
13
+ mixpeek-0.8.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
14
+ mixpeek-0.8.2.dist-info/top_level.txt,sha256=EJ8Jc4IhqyUwnUlBwKbs498Ju4O9a-IDh2kXc_lo6Vg,8
15
+ mixpeek-0.8.2.dist-info/RECORD,,