Skip to main content

The purpose of this project is to count the number of alive and dead pollens in an image.

Project description

PollEncOuNt

The purpose of this project is to count the number of alive and dead pollens in an image.

Contents

Installation

  1. Package installs
pip install PollEncOuNt

Outputs Demonstration

Raw Predicted

blue squares detected are alive, green squares detected ard dead.

count_result.csv summarizes the results after running the prediction process.

Filename Alive Dead
pollen_predicted.jpg 96 20

Usage

GUI

Launching the GUI

Open your terminal (Mac/Linux) or command line (Windows).

Launch the GUI by typing:

% peon

The PEON Main Menu will appear.

Main Menu

From the Actions menu, you can:

  1. Select Train to open the Train GUI.

  2. Select Predict to open the Predict GUI.

  3. Exit the application.

Predict GUI

A Pre-trained Model can directly be used for prediction.

  1. Open the Predict GUI:
  • From the main menu, go to Actions > Predict.
  1. Configure Prediction Settings:
  • Image Files: Click the Browse button and select one or more image files for prediction.
  • Model File: Click the Browse button to load the trained model file (.pt, .pth, or .onnx).
  • Project Save Directory: Click the Browse button to select the directory where the prediction results will be saved.
  • Pridect Settings:
    • Check the Save Images box to save the images with predictions.
    • Check the Save CSV box to save the results in a count_result.csv file.
  1. Start Prediction:
  • Click the Start Prediction button to begin inference.
  • Real-time log updates will appear in the LOGS section.
  1. Reset Prediction:
  • Click the Reset button to clear inputs and logs.

Train GUI

  1. Open the Train GUI:
  • From the main menu, go to Actions > Train.
  1. Configure Training Settings:
  • Data YAML File: Click the Browse button and select a valid YAML file for training data.
  • Project Save Directory: Click the Browse button and choose the directory where training outputs (e.g., logs, model checkpoints) will be saved.
  • Model Selection:
    • For Pre-trained Models: Click the Browse button to select a .pt, .pth, or .onnx model file.
    • For YOLO Models: Use the dropdown menu to choose one of the YOLO models (e.g., yolov8n.pt).
  • Training Settings:
    • Set the number of Epochs for training.
    • Select the device (cpu or gpu) from the dropdown menu.
  1. Start Training:
  • Click the Start Training button to begin.
  • Monitor the real-time log updates in the LOGS section.
  1. Reset Training:
  • To reset the form, click the Reset button. This clears all input fields and logs.

Python API

Predict

A pre-trained model can directly be used for prediction(path: ./model/best.pt).

from peon import peon_predict

results = peon_predict(img_files=["IMG1", "IMG2", ...],
                       model_path: "MODEL_PATH",
                       save_dir: "SAVE_DIR,
                       save_img = True,
                       save_csv = True,)

img_files (list[str]): List of image path to conduct prediction.

model_path (str): Path to the YOLO model.

save_dir (str, optional): Path to the directory to save the results. Required if save_img or save_csv is True.

save_img (bool, optional): Whether to save the predicted images. Defaults to True.

save_csv (bool, optional): Whether to save the results to a CSV file. Defaults to True.

Train

from peon import peon_train

peon_train(data_path="DATA_PATH",
           save_dir="SAVE_DIR",
           model_path = "yolov8m.pt",
           epochs = 100,
           device = "cpu",)

data_path (str): Path to the data .YAML file.

save_dir (str): Path to the directory to save the trained model.

model_path (str, optional): Path to the YOLO model. Defaults to "yolov8m.pt".

epochs (int, optional): Number of epochs for training. Defaults to 100.

device (str, optional): Device to use for training. Defaults to "cpu".

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

pollencount-0.0.5.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

pollencount-0.0.5-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file pollencount-0.0.5.tar.gz.

File metadata

  • Download URL: pollencount-0.0.5.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for pollencount-0.0.5.tar.gz
Algorithm Hash digest
SHA256 df525a462dc6cfb2b70a2203bcbe0455eed9316b3cf367408bd31b9a2a217704
MD5 3a9be7d382623dc63427785ce4f5ce92
BLAKE2b-256 0f03102d7cbad6d192bb4ae57412c0f0119e340cc100cf9550dc00d597ca98d3

See more details on using hashes here.

File details

Details for the file pollencount-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pollencount-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for pollencount-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9c0b63d608e4a351cee063d7efb9297cba702e5cfcbf21104722ff0e9a7f2c32
MD5 e62ef7618c8d8e26185135923902eb6f
BLAKE2b-256 a0750f6f40f054e43cc0bb44a31f7e0aedd83900f16b4926aceb5c6d2f8c8bf5

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