Skip to main content

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

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

quadrantrecon-1.0.2.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

quadrantrecon-1.0.2-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file quadrantrecon-1.0.2.tar.gz.

File metadata

  • Download URL: quadrantrecon-1.0.2.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.2

File hashes

Hashes for quadrantrecon-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d22d2dfc68f5285e926475e7ab50f132e465d8531e48128323532c1298c91359
MD5 adde94efe4ae104c45666020c01e5335
BLAKE2b-256 4c4a1f15bab46caa2c3e074ad7f2cb6f848192875041d29d45fc0596d02abc44

See more details on using hashes here.

File details

Details for the file quadrantrecon-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: quadrantrecon-1.0.2-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

Hashes for quadrantrecon-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b84ae18a17590309d96cd340dd92d500724ec0a37539135852096ea9c2c21f6c
MD5 fb551134530c5629a01109521e7c7bc2
BLAKE2b-256 438de64add51c788ccf77426cd4133374d967d076efd0810f95794fd9b443799

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