ml5-library icon indicating copy to clipboard operation
ml5-library copied to clipboard

StyleTransfer infers the number of filters

Open lindapaiste opened this issue 2 years ago • 0 comments

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?

lindapaiste avatar Jun 12 '22 21:06 lindapaiste