| title | Zebrafish Segmentation Web App |
|---|---|
| emoji | 🐟 |
| colorFrom | blue |
| colorTo | green |
| sdk | gradio |
| sdk_version | 6.3.0 |
| app_file | app.py |
| pinned | false |
Before you begin, you can select the model that will analyze the images. The General Model is trained on a broad dataset. You can choose between a faster model and a more accurate model. Below, you can expand the list of additional models that have been trained and optimized for specific types of photos.
You can upload images of the zebrafish in two ways:
You can upload an entire folder containing zebrafish images.
Select the folder of your choosing from the file dialog:
Then click "Upload" to upload the folder. You'll need to confirm the upload by clicking "Upload" again:
Wait for the images to load and appear:
Alternatively, you can upload individual images one by one.
Select the images of your choosing and click "Open" to upload them:
Wait for the images to load and appear:
Once the images are successfully uploaded, the first one will appear on the screen. The scale bar will be automatically detected and the number of pixels it spans will be displayed.
Enter the physical length printed above the bar (e.g. 500) and its unit, then click Apply to compute the µm/px calibration. The image width/height fields below will be filled automatically.
If automatic detection has incorrectly identified the scale bar, you can use the Manual Scale Bar Entry option below. The image loads automatically below. Click on it to mark the two endpoints of the scale bar line:
- 1st click → START (one end, shown in green)
- 2nd click → END (other end, shown in red)
After both endpoints are set, enter the physical length below and click Apply Manual Points to fill in the calibration automatically.
You can also skip this step and enter the distances manually.
After uploading your images, choose which endpoints you want to analyze:
You can select:
- Length: Measure the length of the zebrafish (centerline path length in µm)
- Curvature: Classify the zebrafish into curvature classes (1-4)
- Class 1: Most severe curvature
- Class 2: Moderate-severe curvature
- Class 3: Mild curvature
- Class 4: Most healthy (minimal curvature)
- Length/Straight Line Ratio: The ratio between the actual centerline length and the straight-line distance between endpoints. A value close to 1.0 indicates a nearly straight fish, while higher values indicate more curvature. This metric quantifies body curvature independently of fish size.
- Eye Size: Calculates the eye area in µm² and measures the eye diameter in µm.
- Edema: Calculates the edema area in µm² .
- Swim Bladder: Calculates the swim bladder area in µm² .
To start the processing, click the Run button.
After processing, you'll see boxplots visualizing the distribution of the selected endpoints. These boxplots are also included in the Excel file:
The boxplots display:
- Fish Lengths: Distribution of measured centerline lengths in µm
- Curvatures: Distribution of curvature classifications (1-4)
- Length/Straight Line Ratio: Distribution of the length ratio metric, where values closer to 1.0 indicate straighter fish
- Eye Area: Distribution of calculated eye areas in µm²
- Edema Area: Distribution of calculated edema areas in µm²
- Swim Bladder: Distribution of calculated swim bladder areas in µm²
The ratio visualization helps identify fish with significant body curvature. You can see in the example image that some fish have ratios above 1.0, indicating curved body shapes:
The cyan line shows the straight-line distance between endpoints, while the actual centerline path (shown in red) is longer due to body curvature. The ratio quantifies this difference.
A gallery displays segmentation overlays for the uploaded images (thumbnails include a short filename label).
If automatic detection fails use Manual Point Adjustment tool to manually set head and tail points.
- Click an image in the gallery above to select it for manual editing
- Click on the large image below to set the HEAD (green, 1st click) and TAIL (red, last click) points
- Optionally click additional midway points between HEAD and TAIL (yellow) to force the path through them
- Click 'Apply Manual Points' to recalculate the length
If you want to correct an incorrect segmentation by yourself, use the Manual Mask Editor tool. After selecting the required image from the gallery at the top, choose the appropriate layer: body, eye, or edema, and click Load Image into Editor.
The tool selection is located on the left. To draw in missing fragments, select the brush tool and the yellow color. To remove excess parts, paint over them with blue. The eraser tool is used to erase the strokes you just drew.
You can also adjust the size of the selected tool by clicking the button at the bottom of the toolbar.
To erase everything you’ve drawn, click the Reset button. To apply the changes, click Apply. After that, the canvas will be cleared, and the updated image will appear in the gallery at the top.
First, select the desired image from the preview at the top, and then click the checkboxes next to the endpoints you want to exclude from the final statistics. Then press the Save Exclusions for This Image button (the row will still appear but the cell will say Excluded and it won't count toward statistics).
In the field below, you can enter sheet name that will be generated.
When you're ready, press the Generate Final Excel button. If the download does not start automatically, click the button again.






















