Image recognition software to crop photos of marine ecosystems. Made for the MBOM Pole to Pole project.
Project description
QuadrantRecon
QuadrantRecon is an image recognition tool designed to crop quadrants from photos of marine ecosystems, as a preprocessing step for CoralNET. As configured by default, this tool will recognize yellow quadrants from the MBOM Pole to Pole Project on any file you select and crop their inside area. The detection parameters can be configured to detect other colors, crop differently sized images, or even ignore different parts of the image to detect other quadrant-like shapes.
Installation
You can install QuadrantRecon via pip:
# Linux
pip install quadrantrecon
# Windows
py -m pip install quadrantrecon
Afterwards, we need to download the model weights. You can find the default one here.
You can change the file name to sam_vit_h.pth and place it in the folder where the program is executed to load it automatically, or you can provide your own file with the --model-path and --model-type flags:
# Linux
python -m quadrantrecon --model-path sam_vit_h_4b8939.pth --model-type vit_h
# Windows
py -m quadrantrecon --model-path sam_vit_h_4b8939.pth --model-type vit_h
Usage
The program can be invoked by using the -m flag as follows. You can use the --help command to see possible options.
# Linux
python -m quadrantrecon --help
# Windows
py -m quadrantrecon --help
You can run the program in batch mode by using more than 1 filename or specifying an input folder.
Development setup
Prerequisites
- Python 3.12 (64 bits)
- Git
- CUDA Toolkit 12.8 (If you want GPU acceleration)
Installing dependencies
First, we need to install the required submodules. We can do this using git:
git submodule update --init --recursive
If you are using another git client, look up how to initialize submodules with it.
Afterwards, we need to download the model weights. You can find the default one here. Change the file name to sam_vit_h.pth and place it in this folder.
Then, we need to install the python dependencies. A virtual env is recommended, but particularly on windows, it might not work correctly, so feel free to skip this step. You can create one to install the program like this:
# Linux
python3.12 -m venv venv/
source venv/bin/activate
# Windows
py -m venv venv/
source venv/Scripts/Activate.ps1
To finish up, we need to install the python dependencies and the package itself. Make sure to choose the correct command for your setup.
# Linux (no CUDA support)
pip install . --index-url https://download.pytorch.org/whl/cpu
# Linux (with CUDA support)
pip install .
# Windows (no CUDA support)
py -m pip install .
# Windows (with CUDA support)
py -m pip install . --index-url https://download.pytorch.org/whl/cu121
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 quadrantrecon-1.0.3.tar.gz.
File metadata
- Download URL: quadrantrecon-1.0.3.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
691ebe61d9bc590e7aee8826309fe89da16338a809b8ee81c5dafee3ff27b139
|
|
| MD5 |
0278198e5f1bbc7fcc812f2b99840de8
|
|
| BLAKE2b-256 |
9a614829acddbfeb0fb01d54b7c79c8ab089bf1d9bf5d4e312b3e3ce114cee45
|
File details
Details for the file quadrantrecon-1.0.3-py3-none-any.whl.
File metadata
- Download URL: quadrantrecon-1.0.3-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50f2da5ba1d80c12a8918d1dc3cb1ac09862ec46eee03be05d2913cbe8ebd9c4
|
|
| MD5 |
505f02eade9e6195ee78b2b9f4723a1f
|
|
| BLAKE2b-256 |
731c05f8d1404c3ce36d4e08f46a7681d5ec044abd940d14d284e0539ce11214
|