Repository navigation
Diagnostics and Troubleshooting
Underwater footage is challenging, and a disappointing result does not necessarily mean that FishTrack has malfunctioned. A fish might be missed when the starting regions are proposed, disappear during tracking, or produce an uncertain outline. FishTrack's logs and diagnostic files can help identify where something went wrong: during proposal, review, tracking or export.
| Symptom | What to check |
|---|---|
| No fish are proposed | Try a clearer starting frame, review the Grounding DINO prompt and proposal threshold, or select the fish manually |
| Coral is proposed as a fish | Remove the box during review. Proposals are suggestions, not verified identifications |
| A fish disappears during tracking | Try a different starting frame or tracking method. Turns, occlusions and similar-looking backgrounds can cause a track to be lost |
| A tracking ID moves onto another object | Treat its identity as uncertain and inspect the video frame by frame. A continuing ID does not guarantee that the same fish is being followed |
| An outline looks wrong | SAM 2 masks are model predictions; conventional outlines can be approximate rather than precise fish silhouettes |
| SAM 2 refuses a long clip | Limit the run to 240 decoded frames or fewer |
| Processing is very slow | Test a shorter interval, select fewer fish and try the Tiny model. Model inference on CPU can be slow |
| A model is missing | Re-run ./scripts/make-venv.sh and check the installation messages. FishTrack does not silently download models when processing starts |
| The output filename already exists | Choose another name or use automatic output naming. FishTrack protects existing files and will not overwrite the source |
| A cancelled run takes time to stop | A model may finish its current operation before responding to cancellation. Unpublished incomplete video is cleaned up |
Before changing lots of settings, try a simple, repeatable test:
- Check that the input MP4 plays normally in another video viewer
- Select a short interval that begins with a clearly visible fish
- Review the proposed or manually selected starting rectangle
- If possible, process the same selection with Conventional CV and SAM 2
- Look for the point where the unexpected result first appears: proposal, review, tracking or export
Changing one setting at a time makes the results easier to interpret. See Settings and Configuration for the available controls.
The main result is an annotated, video-only MP4. FishTrack uses OpenCV's lossy mp4v encoding and retains the source image dimensions and frame rate for the decoded interval. Audio, subtitles and camera metadata are not copied into the result.
The source video is never modified. FishTrack does not publish an incomplete output video after a failed or cancelled run, although a partly populated diagnostics directory may remain for investigation.
When proposal diagnostics are enabled, FishTrack can save:
| File | What it tells you |
|---|---|
roi-proposals.json |
The proposed rectangles, scores and labels before review |
roi-proposals.jpg |
A picture of the original proposals, useful for spotting missed fish or incorrect regions |
selected-rois.json |
The rectangles finally accepted after review or explicit automatic acceptance |
Comparing the original proposals with the accepted rectangles helps distinguish a detection mistake from a later tracking problem. Remember that Grounding DINO's scores rank proposals; they are not calibrated probabilities that a region contains a fish.
A conventional-tracking diagnostics directory can contain aligned grayscale frames, motion-mask PNGs and statistics.csv.
The CSV records information such as the source frame index and time, candidate and observed-track counts, motion-mask pixel count, camera-alignment success, any suppression reason and the number of confirmed tracks. Additional fields describe visually followed tracks, confirmed tracks not currently observed and reasons for tracking failure.
Motion masks show regions that survive the local-motion checks. They are not precise silhouettes of fish: they represent detected motion. In an annotated conventional-CV video, an asterisk (*) after an ID means the object is being followed visually rather than being supported by a fresh motion detection.
These files are especially useful when reef movement produces unwanted detections or when a track disappears unexpectedly.
SAM 2 diagnostics include binary mask PNGs and sam2-statistics.csv, which records each frame/object's tracking ID, source frame and time, mask area in pixels, bounding box and status.
| Status | Meaning |
|---|---|
visible |
A mask was predicted and was large enough to draw |
no_mask |
No mask was available for that object in that frame |
below_min_area |
A predicted mask was smaller than the configured display threshold |
The PNGs preserve model-predicted masks even when a small prediction is not drawn in the final video. A mask appearing again under the same tracking ID is not proof that SAM 2 has recovered the correct individual.
SAM 2 does not generate the camera-aligned frames used by the conventional backend.
The desktop application shows processing messages in its scrolling log. Select Logs… to open the application's log directory on your computer.
Persistent logs are stored in the operating system's Qt application local-data location, under logs/fishtrack.log. The log rotates at approximately 2 MB, retaining three backups. The visible log within the application retains up to 3,000 blocks.
Diagnostic images and CSV files can occupy considerably more disk space than the finished MP4. Use short clips when investigating a problem, and keep a record of the starting time, duration, tracking method and relevant settings.