Python package for easily interfacing with MediaCatch APIs and data formats.
Project description
Python package for easily interfacing with MediaCatch APIs and data formats. Documentation can be found at api.mediacatch.io/mediacatch/docs/.
Requirements
- Python >= 3.10
- MediaCatch API key (contact support@medicatch.io)
Installation
Install with pip
pip install mediacatch
Getting Started
Firstly, add your MediaCatch API key to your environment variables
export MEDIACATCH_API_KEY=<your-api-key-here>
Then you can start using the command line interface
mediacatch --help
usage: mediacatch <command> [<args>]
MediaCatch CLI tool
positional arguments:
{speech,vision,viz} mediacatch command helpers
speech CLI tool to run inference with MediaCatch Speech API
vision CLI tool to run inference with MediaCatch Vision API
viz CLI tool to visualize the results of MediaCatch
options:
-h, --help show this help message and exit
Upload a file to MediaCatch Speech API and get the results
mediacatch speech path/to/file --save-result path/to/save/result.json
# or to see options
mediacatch speech --help
Upload a file to MediaCatch vision API and get the results
mediacatch vision ocr path/to/file --save-result path/to/save/result.json
# or to see options
mediacatch vision --help
Or import as a module
from mediacatch.vision import upload, wait_for_result
file_id = upload(
fpath='path/to/file',
type='ocr',
# Optional parameters with their default values
fps=1, # Frames per second for video processing. Defaults to 1.
tolerance=10, # Tolerance for text detection. Defaults to 10.
min_bbox_iou=0.5 # Minimum bounding box intersection over union for text detection. Defaults to 0.5.
min_levenshtein_ratio=0.75 # Minimum Levenshtein ratio for merging text detection (more info here: https://rapidfuzz.github.io/Levenshtein/levenshtein.html#ratio). Defaults to 0.75.
moving_threshold=50, # If merged text detections center moves more pixels than this threshold, it will be considered moving text. Defaults to 50.
max_text_length=3, # If text length is less than this value, use max_text_confidence as confidence threshold. Defaults to 3.
min_text_confidence=0.5, # Confidence threshold for text detection (if text length is greater than max_text_length). Defaults to 0.5.
max_text_confidence=0.8, # Confidence threshold for text detection (if text length is less than max_text_length). Defaults to 0.8.
max_height_width_ratio=2.0, # Discard detection if height/width ratio is greater than this value. Defaults to 2.0.
get_detection_histogram=False, # If true, get histogram of detection. Defaults to False.
detection_histogram_bins=8, # Number of bins for histogram calculation. Defaults to 8.
)
result = wait_for_result(file_id)
Visualize the results from MediaCatch
mediacatch viz ocr path/to/file path/to/result.json path/to/save.mp4
# or to see options
mediacatch viz --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mediacatch-0.5.0.tar.gz.
File metadata
- Download URL: mediacatch-0.5.0.tar.gz
- Upload date:
- Size: 227.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
249a4d8ebf4b97b47388a41df7d61c4f43032443b367e0d55ae5115dd7631914
|
|
| MD5 |
47ea7f414f5cbe903e3201e0a55f8abe
|
|
| BLAKE2b-256 |
27ad766fceb34d333fb1d5b0d42960a32ba2cd9009e37a8a3554c6b2958e2370
|
Provenance
The following attestation bundles were made for mediacatch-0.5.0.tar.gz:
Publisher:
publish.yaml on mediacatch/mediacatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mediacatch-0.5.0.tar.gz -
Subject digest:
249a4d8ebf4b97b47388a41df7d61c4f43032443b367e0d55ae5115dd7631914 - Sigstore transparency entry: 626678664
- Sigstore integration time:
-
Permalink:
mediacatch/mediacatch@5b954fd1a2408ae4f2d274e184f874fb2ac6013b -
Branch / Tag:
refs/tags/0.5.0 - Owner: https://github.com/mediacatch
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@5b954fd1a2408ae4f2d274e184f874fb2ac6013b -
Trigger Event:
release
-
Statement type:
File details
Details for the file mediacatch-0.5.0-py3-none-any.whl.
File metadata
- Download URL: mediacatch-0.5.0-py3-none-any.whl
- Upload date:
- Size: 187.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf1532f33949c9cfad0eff6c9d18f0713b322c56c65f02095f5238f06a456f2e
|
|
| MD5 |
5e9302693ed2f32349948a20eb55eb47
|
|
| BLAKE2b-256 |
511ad4ad85847de92fa2c55945d373e37b870a0cb677bcb362b311844a2018c8
|
Provenance
The following attestation bundles were made for mediacatch-0.5.0-py3-none-any.whl:
Publisher:
publish.yaml on mediacatch/mediacatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mediacatch-0.5.0-py3-none-any.whl -
Subject digest:
bf1532f33949c9cfad0eff6c9d18f0713b322c56c65f02095f5238f06a456f2e - Sigstore transparency entry: 626678670
- Sigstore integration time:
-
Permalink:
mediacatch/mediacatch@5b954fd1a2408ae4f2d274e184f874fb2ac6013b -
Branch / Tag:
refs/tags/0.5.0 - Owner: https://github.com/mediacatch
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@5b954fd1a2408ae4f2d274e184f874fb2ac6013b -
Trigger Event:
release
-
Statement type: