Skip to main content

Python package to extract deep learning features

Project description

Overview

Minimalistic python package to extract deep learning features from a wide variety of pretrained models in Pytorch.

Installation / Usage

Dependencies:

  • pytorch (v >= 1.0.0)

  • torchvision

To install use pip:

$ pip install imfeatures

Or clone the repo:

$ git clone https://github.com/resbyte/imfeatures.git

$ python setup.py install

Example

  • Imports

`python import imfeatures import torch `

  • create feature extractor, here resnet50, with pretrained weights

`python feature_extractor = imfeatures.Features('resnet50',pretrained=True) `

  • random image of size 224x224x3

`python x = torch.randn([1,3,224,224]) `

  • features

`python features = feature_extractor(x) print(features.shape) `

Output features will be of shape : [1, 2048, 1, 1]

Author

Abhinav Dadhich

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imfeatures-0.0.2.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

imfeatures-0.0.2-py2.py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page