Mirk is a vision-reasoning pipeline designed to interpret scenes only when needed.
Project description
Mirk
Mirk is a library and a pipeline that combines classical Computer Vision (CV) models with Large Visual Models (LVMs) to provide detailed analysis and understanding of a video. The classical CV model handles initial processing and object detection, while the LVM generates rich, contextual interpretations of the visual content.
Overview
Mirk works by:
- Taking an input video
- Using a CV model to detect objects of interest. Objects (classes) of interest are specified by the user
- When a specified object is identified, triggering a VLM to generate detailed explanations about what is seen in the video, to reason about the detected object and its context based on the provided question
Installation
pip install mirk
Quick Start
Check out the example to see how to use Mirk.
For your convenience, we provide a bash script that downloads a sample video and runs the one-shot example:
cd examples
./one_shot.sh
with the following output:
[download] Destination: input/selective_attention_test.mp4
...
[download] 100% of 2.63MiB in 00:00:00 at 5.80MiB/s
Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to '.../mirk/mirk/models/yolo11n.pt'...
100%|███████| 5.35M/5.35M [00:00<00:00, 7.07MB/s]
video 1/1 (frame 1/2447) .../mirk/examples/input/selective_attention_test.mp4: 480x640 (no detections), 172.3ms
video 1/1 (frame 2/2447) .../mirk/examples/input/selective_attention_test.mp4: 480x640 (no detections), 145.1ms
video 1/1 (frame 3/2447) .../mirk/examples/input/selective_attention_test.mp4: 480x640 (no detections), 134.0ms
...
video 1/1 (frame 361/2447) .../mirk/examples/input/selective_attention_test.mp4: 480x640 5 persons, 160.9ms
Found person in frame 360 with confidence 0.88
Saved frame to: output/detected_person_frame_360.jpg
Question: What are the people doing in the image?
Answer: The people in the image are playing with basketballs, passing them to each other. There is a group of individuals, and some are walking while others are engaged in the activity. It's a scene from a well-known experiment involving selective attention.
Credentials
Mirk uses the following APIs:
You need to set up your own credentials for OpenAI API. See .env.example file.
You don't need to set up credentials for YOLO.
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 mirk-0.1.0.tar.gz.
File metadata
- Download URL: mirk-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
748733186d791dc2b643acc9cfe2fc0eccd3373dcb6f81cadc3215b064cb452f
|
|
| MD5 |
52ad9e34bc0be6a0df1324decc512707
|
|
| BLAKE2b-256 |
cb0898ac6ca495a34dc2446b229d08b152d289384d8786bb814144d25a72ebd4
|
File details
Details for the file mirk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mirk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e059bd5c8603237cec497a75ae0169f3dda823aa31c0776d79618423f706243
|
|
| MD5 |
71a95c87d1a0fd9f8d36d3f7aae07c3b
|
|
| BLAKE2b-256 |
b2b09f6a10d568577be4aceb2b00121223f64d431d8cc4fcaa4e7997cf45acd3
|