[tfjs-data] Update webcam tests for tfjs-core@1.2.9 #1979
Merged
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.
tf.browser.fromPixel is using HTMLVideoElement.videoHeight and videoWidth now. The previous fake video stream does not populate videoHeight and videoWidth for the upstream HTMLVideoElement.
Using a test video to mock the video source. The video size is used as the output tensor shape so the params passed to API are not used in tests. This is because faking media stream does not populate videoHeight and videoWidth for HTMLVideoElement.
The resizing tests works fine because the
cropAndRezide()function still works fine.The API has been tested and real webcam works the same as before.
This change is