Pytorch Feature Map Extractor
Project description
MapExtrakt
Convolutional Nerual Networks Are Beautiful
We all take our eyes for granted, we glance at an object for an instant and our brains identify objects with ease. However distorted this information may be, we do a pretty good job at it.
Low light, obscured vision, there are a myriad of situations where conditions are poor but still we manage to understand what an object it. Context helps, but we were created with sight in mind.
Computers have a harder time, but modern advances with Convolutional Neural Networks are making this task a reality and have now surpassed human level accuracy.
Computers are beautifull, Convolutional Neural Networks are beautifull. And the maps they create to determine what makes a cat a cat are beautiful.
MapExtrakt makes viewing feature maps a breeze.
# load a model
import torchvision
model = torchvision.models.vgg16(pretrained=True)
#import FeatureExtractor
from MapExtrakt import FeatureExtractor
#load the model and image
fe = FeatureExtractor(model)
fe.set_image("cat.jpg")
#gather maps
img = fe.display_from_map(layer_no=2, out_type="pil", colourize=20, outsize=(1000,500), border=0.03, picture_in_picture=True)
img.save("example_output.jpg")
img
View Layers At a Time
#gather maps
img = fe.display_from_map(layer_no=2, out_type="pil", colourize=20, outsize=(1000,500), border=0.03, picture_in_picture=False)
img.save("example_output.jpg")
img
Export Cells Of Each Layer To Video
#gather maps
fe.write_video(out_size=(1000,500), file_name="output.mp4", colourize=20,
border=0.03, fps=60, frames_per_cell=1, fade_frames_between_cells=6,
write_text=True, picture_in_picture=True)
Installation
Is as easy as pie
pip install mapextrakt
or build from source in terminal
git clone https://github.com/lewis-morris/mapextrackt
cd mapextrackt
pip install -e .
More Examples
Why not view the jupyter notebook with more examples of usage.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file mapextrackt-0.1-py3.7.egg
.
File metadata
- Download URL: mapextrackt-0.1-py3.7.egg
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 359a8150d86e56fcceeb47ea23d2915b3c5ab91aeb2cc07ca1ba3bc7a11d8bdd |
|
MD5 | 79a2fba3598024e3b2c512b04847cfec |
|
BLAKE2b-256 | 79859f691ba5bc40047fa3ef760c73e9c86e99dcc30a7db94da451fd38844847 |
File details
Details for the file mapextrackt-0.1-py3-none-any.whl
.
File metadata
- Download URL: mapextrackt-0.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a815d7b5a8f76f9aad3e7fd24a6b24f0d0bfbd18ee4944e6b175acaaf824d523 |
|
MD5 | c8517cde342f6ea729c8ae602c8003c4 |
|
BLAKE2b-256 | 8f09d22b296cc3493dda163abbee711d5fb75209d6080221f3e3aaa65c5434f6 |