Skip to content

Latest commit

 

History

History
65 lines (55 loc) · 2.64 KB

Readme_StomaApp.md

File metadata and controls

65 lines (55 loc) · 2.64 KB

StomaApp

An easy-to-use interface for counting stomata in microscopy images of maize leaves using gradio.

Overview

Overview of StomaApp

StomaApp consists of 4 tabs. In the first one, the user is asked to upload files. Currently, the app accepts zip files with the following format:
  • name_zip.zip
    • name_folder
      • name_subfolder1
        • image1.png
        • image2.png
        • ...
      • name_subfolder2
        • image3.png
        • image4.png
        • ...

The individual images should be in png format (either gray-scale or RGB).

By pressing the "Predict" button, the app will process every image in the zip file using the model called stoma_detector.pth in the StomaApp/models directory. A progress bar also shows the percentage of currently processed images. The uploaded zip file will be saved in StomaApp/data/zips.

Upload and process Files

In the background, the model's predictions are saved into a mySQL database (StomaApp/data/stoma.db) and can be viewed in the next two tabs: The tab Show Summary will show a database table, where one row holds the information of all counted and filtered stomata in one image.

Show Summary

The tab Show Details will show a database table, where each predicted stoma is saved as one row. This is used to better understand the model's predictions and error sources.

Show Details

Finally, the last tab lets the user download the Summary and Detail tables as csv file.

Download Data

Installation

  1. Clone this project
git clone git@github.com:grimmlab/StomaDet.git
  1. Adjust the Dockerfile in StomaDet/StomaApp, so the user matches your name and id.

  2. Install StomaApp

cd StomaDet/StomaApp
docker build -t stoma_app .
  1. Download trained model from Mendeley Data (TODO: add link) and paste the unzipped model (pth and yaml file) in StomaDet/StomaApp/models.

Start the app

docker run -it -v /path/to/github/repo/StomaDet/StomaApp/:/workspace -p 9000:9000 --workdir /workspace --runtime nvidia --gpus device=0 --name stoma_app stoma_app
python3 app.py
# to start the app with an empty database, use:
python3 app.py --delete_db True

The StomaApp webserver will be accessible through docker via port 9000 (usually 127.0.0.1:9000).