ml5-library
ml5-library copied to clipboard
StyleTransfer infers the number of filters
Extends #1380
Closes #281
This PR removes some of the hard-coded values in StyleTransfer
so that it can work with user-trained models which were trained using a different number of filters. Specifically, the Van Gogh models here.
We can derive the numFilters
by looking at the shape of the filter variable. These shapes are specified in the manifest.json, but I'm just looking at the filter tensor directly.
The input does not need to be any particular size, so I am removing the IMAGE_SIZE
and the Video
base class which uses it. The resizing didn't work anyways! We still have issues with video loading in Safari, though I'm getting a different error than before.
I wonder if the strides
is also something that's variable which we want to infer?