Spaces:
Sleeping
Sleeping
metadata
title: Petri Net Converter Suite
emoji: π
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
license: mit
Petri Net Converter Suite
A Gradio-based application that converts hand-drawn Petri net sketches into digital formats using computer vision and OCR.
Demo
π Try the live demo on Hugging Face Spaces
What it does
The application processes images of Petri net diagrams and automatically:
- Detects places, transitions, and arcs using computer vision
- Extracts text labels using OCR
- Converts the detected elements into standard formats (PNML, JSON, GraphViz, etc.)
- Provides visual feedback of the detection process
Setup
Requirements
Python 3.8+ and the dependencies listed in requirements.txt
.
Installation
- Clone the repository:
git clone <repository-url>
cd petri-net-converter
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables (optional, for full functionality):
cp env.example .env
# Edit .env and add your API keys:
# GROQ_API_KEY=your_groq_api_key_here
# ROBOFLOW_API_KEY=your_roboflow_api_key_here
- Run the application:
python app.py
The application will start on http://localhost:7860
.
Usage
- Image Processor Tab: Upload an image of a Petri net sketch and a YAML configuration file, then click "Process"
- Configuration Editor Tab: Create or modify YAML configuration files for processing parameters
- Petri Net Converter Tab: Convert processed results into various output formats
Supported Formats
- Input: PNG, JPG, JPEG images + YAML configuration files
- Output: PNML (XML), PetriObj, JSON, GraphViz DOT, PNG visualizations
License
MIT License