Skip to main content

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:

  1. Taking an input video
  2. Using a CV model to detect objects of interest. Objects (classes) of interest are specified by the user
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mirk-0.1.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mirk-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file mirk-0.1.1.tar.gz.

File metadata

  • Download URL: mirk-0.1.1.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

Hashes for mirk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5dc15bfac7a44c67f12d883cdec8a81b186a91f3c17a48f44bb52c3c2da137ce
MD5 c33fb59c8e862511ea85f6d5233121e9
BLAKE2b-256 039cd4f9b42284babf89df0314ff7a1c7d805a79b8e7e43422a16538b997b1d1

See more details on using hashes here.

File details

Details for the file mirk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mirk-0.1.1-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

Hashes for mirk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0768c797f1bd94d142ccce8a5740bb57762e68de5baab91a983d37c889023788
MD5 74698091c029dd36053c713736df5552
BLAKE2b-256 299efbd76433222b716fedfd292fa15fba38b56a4feb0f97a7a2554e95ed034e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page