How indrajithekanayake/reverse-engineering-piping-and-instrumentation-drawings-a-deep-learning-approach works
This Flask application lets a user upload a piping-and-instrumentation drawing, stores a resized copy, and requests OCR-based PDF conversion. A separate prediction endpoint accepts image data, preprocesses it, and uses a loaded Keras model to return a symbol label and confidence. The graph shows these as distinct workflows; template-side interactions are inferred from the routes and are marked unverified because the templates were not sampled.
Main entry points: app.py Flask routes · results.html Results page · index.html Upload page · uploads Uploaded images
Components 14
Web interface
- Flask routes
app.py - Upload page
templates/index.html - Results page
templates/results.html
Upload and OCR
- Image upload
app.py - Uploaded images
static/uploads - Image resizing
app.py - OCR PDF service
- Generated PDFs
static/pdf
Symbol prediction
- Prediction endpoint
app.py - Image preprocessing
app.py - Model definition
model.json - Model weights
model.h5 - Symbol classifier
app.py
Other components
- User
Connections 17
- User → Upload page: submits image
- Flask routes → Upload page: renders
app.py - Flask routes → Image upload: routes upload
app.py - Image upload → Uploaded images: saves original
app.py - Image upload → OCR PDF service: requests OCR
app.py - OCR PDF service → Generated PDFs: writes PDF
- Image upload → Image resizing: resizes image
app.py - Image resizing → Uploaded images: saves resized
app.py - Flask routes → Results page: renders results
app.py - Results page → User: displays result
- User → Prediction endpoint: sends image data
- Flask routes → Prediction endpoint: routes prediction
app.py - Prediction endpoint → Image preprocessing: calls prediction
app.py - Image preprocessing → Symbol classifier: predicts image
app.py - Symbol classifier → Model definition: loads architecture
app.py - Symbol classifier → Model weights: loads weights
app.py - Prediction endpoint → User: returns JSON
app.py