A command-line tool to run YOLO object detection live on your screen.
Project description
yoloscr: Live Screen Object Detection
A simple and powerful command-line tool to run any Ultralytics YOLO model for live object detection directly on a region of your screen.
It's perfect for developers, researchers, and hobbyists who want to quickly apply object detection to videos, games, or any application window without complex code.
Features
- Live Detection: Run YOLO models in real-time on your screen.
- Customizable Region: Specify any part of your screen for detection.
- Model Agnostic: Works with any
*.ptmodel file from the Ultralytics ecosystem. - Highly Configurable: Control confidence, FPS, window visibility, and logging via simple command-line flags.
- Cross-Platform: Works on macOS, Windows, and Linux (with OS-specific setup).
Installation
You can install yoloscr directly from PyPI:
pip install yoloscr
Crucial Operating System Setup
Because this tool needs to see your screen, you may need to grant permissions first.
macOS (Required)
On macOS, you must grant screen recording permissions to your terminal application.
- Open System Settings.
- Go to Privacy & Security > Screen Recording.
- Find your terminal application (e.g.,
Terminal,iTerm2,Visual Studio Code) in the list. - Enable the switch next to it.
- You will be prompted to "Quit & Reopen" the application. This is necessary for the changes to take effect.
Windows & Linux
On most Windows and Linux systems, no special permissions are required. It should work out of the box.
Usage
The tool is run from your terminal. The basic command requires a YOLO model file.
# Use a pre-trained model downloaded automatically
yoloscr --model yolov8n.pt
# Use your own fine-tuned model
yoloscr --model "runs/detect/train/weights/best.pt"
Command-Line Arguments
You can customize the detection with the following arguments:
| Argument | Default | Description |
|---|---|---|
--model |
yolov8n.pt |
Path to the YOLO .pt model file. |
--region |
0 0 960 1080 |
Screen region to capture as left top width height. |
--conf |
0.30 |
Confidence threshold for detection (e.g., 0.5 for 50%). |
--fps |
10 |
Frame rate to limit the capture. |
--hide-window |
(not set) | Flag to disable the live preview window. |
--verbose |
(not set) | Flag to print detected object logs to the terminal. |
--title |
yoloscr... |
Custom title for the preview window. |
Practical Examples
1. Detect on a 400x400 area at the top-left of the screen:
yoloscr --model yolov8n.pt --region 0 0 400 400
2. Use your custom model with high confidence and see logs: Drag the preview window out of the capture area to avoid the "mirror" effect.
yoloscr --model path/to/my/best.pt --conf 0.75 --verbose
3. Run headless (no preview) and just log detections in the terminal: This is useful for running automated scripts.
yoloscr --model yolov8n.pt --hide-window --verbose
License
This project is distributed under the MIT License. See the LICENSE file for more information.
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 yoloscr-0.1.0.tar.gz.
File metadata
- Download URL: yoloscr-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09262c94e3c08772721bf16f20be571fb4874357b8b6b73605bf721344d70738
|
|
| MD5 |
8709f262956476a2762c3ece4a3f0e27
|
|
| BLAKE2b-256 |
77aaad06ae9373f4d7cc51622950a6be4a444b39bb58c255ee875d01671b171c
|
Provenance
The following attestation bundles were made for yoloscr-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on aaurelions/yoloscr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yoloscr-0.1.0.tar.gz -
Subject digest:
09262c94e3c08772721bf16f20be571fb4874357b8b6b73605bf721344d70738 - Sigstore transparency entry: 291317110
- Sigstore integration time:
-
Permalink:
aaurelions/yoloscr@32f03529d6e12bbb49b5cd356f48fba212f40bdd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aaurelions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@32f03529d6e12bbb49b5cd356f48fba212f40bdd -
Trigger Event:
push
-
Statement type:
File details
Details for the file yoloscr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: yoloscr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6c5bf73584c96226e06e54cf7c99cb5b013c90da5cae343609e312d181f3c6a
|
|
| MD5 |
ac3f1590ef6096d7cd1764c15282df86
|
|
| BLAKE2b-256 |
c1d0d80bbeaad8f8feb9fffed203a396fc0e00490a28236a4cf9ea65a36a4ff6
|
Provenance
The following attestation bundles were made for yoloscr-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on aaurelions/yoloscr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yoloscr-0.1.0-py3-none-any.whl -
Subject digest:
d6c5bf73584c96226e06e54cf7c99cb5b013c90da5cae343609e312d181f3c6a - Sigstore transparency entry: 291317132
- Sigstore integration time:
-
Permalink:
aaurelions/yoloscr@32f03529d6e12bbb49b5cd356f48fba212f40bdd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aaurelions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@32f03529d6e12bbb49b5cd356f48fba212f40bdd -
Trigger Event:
push
-
Statement type: