Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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

Release history Release notifications

This version


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-py2.py3-none-any.whl (3.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size imfeatures-0.0.2.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page