Skip to main content

Python package to extract deep learning features

Project description


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

Installation / Usage


  • pytorch (v >= 1.0.0)
  • torchvision

To install use pip:

$ pip install imfeatures

Or clone the repo:

$ git clone

$ python install


  • 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]


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.

Files for imfeatures, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size imfeatures-0.0.2.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View
Filename, size imfeatures-0.0.2-py2.py3-none-any.whl (3.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page