How afshazareen/oil_spill_segmentation works
This is a Flask oil-spill image segmentation web app. A user submits an image; the Flask route saves it and invokes inference, which preprocesses the image, runs the U-Net, and generates a binary mask and red overlay. The route then returns the configured output file to the browser. In the shown call, that file is saved as the mask path, so the response is the mask rather than the separately generated overlay described by the README. The source excerpts establish the main runtime links; template-side behavior beyond the README is not inspected.
Main entry points: inference.py Inference pipeline · app.py Flask routes · index.html Upload page · static Static output
Components 10
Web interface
- Upload page
templates/index.html
Request runtime
- Flask routes
app.py
Segmentation inference
- Inference pipeline
inference.py - U-Net architecture
model_arch.py - Trained weights
model.pth
Image artifacts
- Uploaded images
uploads - Binary mask
inference.py - Red overlay
inference.py - Static output
static
Other components
- Image uploader
Connections 12
- Image uploader → Upload page: uploads image
README.md - Upload page → Flask routes: submits image
README.md - Flask routes → Upload page: renders page
app.py - Flask routes → Uploaded images: saves upload
app.py - Flask routes → Inference pipeline: runs inference
app.py - Inference pipeline → U-Net architecture: loads model
inference.py - Inference pipeline → Trained weights: loads weights
inference.py - Inference pipeline → Binary mask: creates mask
inference.py - Inference pipeline → Red overlay: blends overlay
inference.py - Inference pipeline → Static output: saves outputs
inference.py - Flask routes → Static output: sends output
app.py - Static output → Image uploader: returns image