A FastAPI-based web application for pairwise image comparison and selection. Designed for lightweight expert input collection through a simple web interface, the app shows randomized pairs of images and records user preferences, while avoiding repeated combinations. Additionally, it provides on-the-fly TIFF-to-PNG conversion for compatibility with web formats.
- Randomly display two unique images from a local folder
- Prevent repetition of image pairs
- Record user selections in a CSV file
- Convert TIFF images to PNG for browser display
- Automatically archive selections when all combinations are exhausted
- Python 3.8+
- pip
-
Clone the repository:
git clone https://github.com/your-org/exo-webapp.git cd exo-webapp -
Install dependencies:
pip install -r requirements.txt
.
├── images/ # Place your TIFF image files here
├── static/ # Optional static assets (CSS, JS)
├── templates/ # HTML templates (Jinja2)
├── selections.csv # Auto-generated CSV file for selections
├── main.py # Main FastAPI application
├── LICENSE
└── README.md
-
Add your
.tiffimages to theimages/folder. -
Start the application:
uvicorn main:app --reload
-
Open your browser and go to:
http://127.0.0.1:8000 -
Select one image from each pair. Once all unique pairs have been shown, the app will:
- Archive the current
selections.csvwith a timestamped filename. - Clear the original
selections.csvfile. - Reset the comparison session. The selection.csv will remain active if you want to create other session. Beware that this version the csv is not tracking the sets, so if you restart the server you wipe out the combination tracker.
- Archive the current
-
You can find your results in the root folder as
.csvfiles.
This project is licensed under the MIT License. See LICENSE for details.
Marco Prenassi
Laboratory of Data Engineering
Istituto di ricerca per l'innovazione tecnologica (RIT)
Area Science Park, Trieste, Italy