Desktop GUI application for training and running inference with Detectron2 models
Project description
AlchemyDetect
A desktop GUI application for training and running inference with Detectron2 models.
Features
- Train object detection and instance segmentation models with a visual interface
- Live monitoring — real-time loss plot and training logs
- Inference on single images or entire folders with result visualization
- Model management — save and load trained weights for later use
- Export trained models to ONNX or TensorRT for faster deployment
- Deploy — run exported ONNX/TensorRT models in-app, independent of Detectron2
Supported Models
| Model | Task |
|---|---|
| Faster R-CNN (R50-FPN, R101-FPN) | Object Detection |
| RetinaNet (R50-FPN, R101-FPN) | Object Detection |
| Mask R-CNN (R50-FPN, R101-FPN) | Instance Segmentation |
Quick Start
# Install dependencies (see INSTALL.md for detailed setup)
pip install -r requirements.txt
# Run the application
python main.py
Dataset Format
AlchemyDetect uses COCO JSON format for training datasets. You need:
- A directory containing your training images
- A COCO-format JSON annotation file
Usage
Training
- Open the Train tab
- Select your training images directory and COCO JSON annotation file
- Choose a model architecture from the dropdown
- Set hyperparameters (learning rate, iterations, batch size)
- Choose an output directory
- Click Start Training
- Monitor progress via the log viewer and loss plot
Inference
- Open the Inference tab
- Click Load Model and select a trained
.pthfile (config.yaml will be auto-detected if in the same directory) - Adjust the confidence threshold
- Click Run on Image or Run on Folder
- Browse results using the navigation buttons
Export (ONNX)
- Install the export extra:
pip install alchemydetect[export] - Open the Export tab
- Click Load Model... and select a trained
.pthfile (config.yaml is auto-detected) - Choose ONNX, set the opset / input size / fp16 / dynamic-axes options
- Pick an output directory and click Export
- The output directory will contain
model.onnx, the copiedconfig.yaml/class_names.json, and anexport_metadata.jsondescribing the model
Detection models (Faster R-CNN, RetinaNet) export reliably. Mask R-CNN (instance segmentation) export is experimental.
ONNX export requires the
onnxpackage — if you skip the[export]extra the Export tab will tell you to install it. TensorRT export appears as a format option only when thetensorrtpackage is installed (build the ONNX first, then amodel.engine); install TensorRT manually to match your CUDA/cuDNN.
Deploy (run exported models)
- Open the Deploy tab
- Click Load Model... and select an exported
model.onnxormodel.engine(itsexport_metadata.jsonmust sit alongside it — produced by the Export tab) - Adjust the confidence threshold
- Click Run on Image or Run on Folder and browse results
ONNX runs via onnxruntime (GPU provider used automatically when available);
.engine files run via a TensorRT runtime (requires tensorrt + pycuda).
Both are independent of Detectron2's predictor. The side panel shows the active
runtime provider and the per-image detection time so you can confirm whether
inference is on CPU or GPU.
If exported ONNX/TensorRT inference seems slow, check the provider label — if it says
CPUExecutionProvider, onnxruntime fell back to CPU (it needs a CUDA runtime matching youronnxruntime-gpubuild). The real speedups come from GPU
- TensorRT.
For how the TensorRT path works and exact install steps (Linux/Windows/Docker), see docs/TensorRT.md.
Logs
The app writes a timestamped session log to a logs/ directory (set
ALCHEMYDETECT_LOG_DIR to change the location). Training/export output and
inference errors — including worker tracebacks — are mirrored there so you can
analyze issues after the fact. The active log path is shown in the status bar.
Tech Stack
- Python 3.10 or 3.11
- PyQt6 — Desktop GUI
- Detectron2 — Object detection / instance segmentation
- PyTorch — Deep learning backend
- pyqtgraph — Real-time loss plotting
Security
Loading a model .pth ultimately calls torch.load, which unpickles the file and
can execute arbitrary code. Only load model weights you trained or otherwise
trust — treat .pth files like executables. Exported .onnx/.engine files and
COCO/config files are loaded with safe parsers.
License
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
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 alchemydetect-0.5.0.tar.gz.
File metadata
- Download URL: alchemydetect-0.5.0.tar.gz
- Upload date:
- Size: 47.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9256ddb53005e05e9b2ab7b107c34143cab0a3bdc5fe6f8d054183b136fcf4e
|
|
| MD5 |
637e94889f452876e3ab2828d4093424
|
|
| BLAKE2b-256 |
b38b698be18fcf724ab81dbceb9d63d8aa00dde3f331e407561dbb6dbb5e6fe1
|
Provenance
The following attestation bundles were made for alchemydetect-0.5.0.tar.gz:
Publisher:
publish.yml on kouya-marino/AlchemyDetect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alchemydetect-0.5.0.tar.gz -
Subject digest:
a9256ddb53005e05e9b2ab7b107c34143cab0a3bdc5fe6f8d054183b136fcf4e - Sigstore transparency entry: 1679687610
- Sigstore integration time:
-
Permalink:
kouya-marino/AlchemyDetect@3e1de1acaa70fc477e008e9ccddad3491ec8700b -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/kouya-marino
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e1de1acaa70fc477e008e9ccddad3491ec8700b -
Trigger Event:
push
-
Statement type:
File details
Details for the file alchemydetect-0.5.0-py3-none-any.whl.
File metadata
- Download URL: alchemydetect-0.5.0-py3-none-any.whl
- Upload date:
- Size: 51.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5d5a2f51583bfc8b9bf8569556ff482c9f638a4112ad4453aab96e28ae047a5
|
|
| MD5 |
9202d941ddeef8baaf7656fef30d128c
|
|
| BLAKE2b-256 |
b90f895da868b6c63b8d95f087f25a291f9de043f3a03ecf8ba170b55a174604
|
Provenance
The following attestation bundles were made for alchemydetect-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on kouya-marino/AlchemyDetect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alchemydetect-0.5.0-py3-none-any.whl -
Subject digest:
d5d5a2f51583bfc8b9bf8569556ff482c9f638a4112ad4453aab96e28ae047a5 - Sigstore transparency entry: 1679687778
- Sigstore integration time:
-
Permalink:
kouya-marino/AlchemyDetect@3e1de1acaa70fc477e008e9ccddad3491ec8700b -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/kouya-marino
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e1de1acaa70fc477e008e9ccddad3491ec8700b -
Trigger Event:
push
-
Statement type: