Graph Neural Network Library Built On Top Of PyTorch and PyTorch Geometric
Project description
IMGRAPH
Used for converting image to graph, uses superpixel method for node creation, extract features from CNN models.
Example Usage:
from imgraph.pipeline import create_graph_pipleline
path = "path/to/image"
create_graph_pipleline(path, 'classification', 'rag', 'resnet18', 10)
Above code will create a graph from the image and save it in the directory .~/cache/imgraph or directory specified by the user in enviornment variable IMGRAPH_HOME.
Expected input folder structure:
image_folder
├── test
│ ├── class1
│ └── class2
├── train
│ ├── class1
│ └── class2
└── val
├── class1
└── class2
The graph will be saved in the PyG Data format or pickle format.
To install pytorch geometric dependencies, please follow the instructions here: PyG installation or use the following code snippet:
To install full dependeciens install using setup.py with full-dependencies flag (its slow, but will install all dependencies)
import torch
def format_pytorch_version(version):
return version.split('+')[0]
TORCH_version = torch.__version__
TORCH = format_pytorch_version(TORCH_version)
def format_cuda_version(version):
return 'cu' + version.replace('.', '')
CUDA_version = torch.version.cuda
CUDA = format_cuda_version(CUDA_version)
!pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-geometric
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
imgraph-0.0.9.tar.gz
(92.1 kB
view details)
Built Distribution
imgraph-0.0.9-py3-none-any.whl
(37.2 kB
view details)
File details
Details for the file imgraph-0.0.9.tar.gz
.
File metadata
- Download URL: imgraph-0.0.9.tar.gz
- Upload date:
- Size: 92.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4d394ba4c2bdceab0e076c404f0d686332324cd2a7da7b3ee2daece305c7840 |
|
MD5 | 473852b0701616cf6fa4da706c057166 |
|
BLAKE2b-256 | 93e1ca1cb143a216e943b7b1dd1ee7795dc2c324337b41353b854aa8442e22ee |
File details
Details for the file imgraph-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: imgraph-0.0.9-py3-none-any.whl
- Upload date:
- Size: 37.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 864e734a50e489b63c3ad7f86070ad2209af9b4ff652d24dfa9f6c664bc331df |
|
MD5 | 5e5014ecfde5a10dee412fc9dc726d75 |
|
BLAKE2b-256 | a0dbe4a2fbd44f3c2a640e3a0eb2ee5539e6fcfed55a2eaef767d9a7e97aef28 |