Adding timeout fix for SAM #7
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why is this change being made?
The Segment Anything (
sam) model automation was failing with two timeout errors. The first waslocator('#latency')timing out at 30s because the element doesn't exist in the sample. The actual ID is#decoder_latency. The second waslocator('canvas').first()timing out at 60s because model loading (~187MB) regularly exceeds that window.What changed?
Fixed the latency selector from
#latencyto#decoder_latencyto match the actual element ID in the Segment Anything sample, and changed the canvas selector from genericcanvasto the specific#img_canvas. The canvas visibility timeout was increased from 60s to 300s to allow time for the SAM encoder (171MB) and decoder (15.7MB) to download and compile.Additionally, an encoder-readiness check was added that polls the canvas cursor style, waiting for it to change from
"wait"before clicking. This ensureshandleImage()has finished running the encoder on the default image.How was the change tested?
Ran the SAM model case end-to-end on an NVIDIA RTX 5060 Ti with DML EP using
node src/main.js --suite model --model-case sam --chrome-channel canary. The test passed in 24.5s. Canvas loaded, encoder processed the default image, the click triggered segmentation, and decoder latency was captured successfully. I am hitting some other problems with testing on TRT RTX EP, but I think those are unrelated to the automation.