Comments (5)
Absolutely. Though with crema, there's a circular dependency problem: crema depends on pumpp, so we can't have pumpp depend on crema.
Probably the best option here is to add a pumpp feature extractor class to each crema model. This should be fairly easy to do. Extending foreign objects (ie from another package) is generally a bad idea, but in this case, we're in control of both packages so it shouldn't be a huge deal.
from pumpp.
Also crema... which I think is gonna be my use case.
Why would this involve an api change?
from pumpp.
Caveat about wrapping pre-trained embedding in general:
If the model contains things like custom Keras layers that can’t be pickled directly, then the resulting pump object won’t be picklable, which may come as a surprise to Pumpp users... This also means things like parallelization with pump that wraps an un-deserializeable model will break with hard to parse error messages...
from pumpp.
I like the idea of making CremaModel
automatically usable as a pumpp. For openl3
and vggish
and other models, I feel like it might make sense to have them in pumpp and just not imported by default.
import pumpp
from pumpp.feature.integrations import vggish, openl3, keras
pump = pumpp.Pump(vggish.VGGish(...), openl3.OpenL3(...), keras.H5Model(...))
If we do that, then we don't have to worry about circular dependencies so we could add Crema
as well for consistency. Just a thought.
(Or alternatively we can have them imported by default and do:
from pumpp.feature.base import FeatureExtractor
class Crema(FeatureExtractor):
def __init__(self, name='crema', model_dir='./model', *a, **kw):
from crema.models.base import CremaModel
self.model = CremaModel()
self.model._instantiate(os.path.abspath(model_dir))
super().__init__(name, *a, **kw)
def transform_audio(self, y):
return self.model.outputs(y=y, sr=self.sr)
)
Not sure what the protocol for using models that are outside of the crema repo is tho.
from pumpp.
Actually maybe the best option would be to do what @bmcfee suggested (crema model extending Pump) and then add vggish and openl3 as crema models.
from pumpp.
Related Issues (20)
- Make our own label vectorizer
- Detect when input data is too short for the sampler
- Viterbi decoding
- Display linkage
- vector HOT 11
- Quantization for feature transforms
- Explicit dtypes
- DL framework integration
- Drop legacy python
- Fix dtypes to make keras happy
- Default names for transformers ; make all parameters keyword-only HOT 6
- Add FeatureExtractor/TaskTransformer aggregations for Sampler HOT 2
- Faster patch sampling using librosa 0.7.1 frame
- [Feature Proposal] Automatic Pump caching HOT 7
- [Feature] optional explicit frame size for inputs HOT 3
- extra dimension added to feature extractors HOT 1
- Cannot pickle sampler if `random_state` is not set HOT 2
- support tf2.0 HOT 3
- Relying on "keras only" for building layers is limiting! HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pumpp.