Skip to main content

convnets

🚧 Under construction

Convolutional Neural Networks and utilities for Computer Vision.

Models API

convnets offers implementations for the following models:

To instantiate a model you need to import the corresponding class and pass a valid configuration object to the constructor:

from convnets.models import ResNet

r18_config = {
	'l': [
		{'r': 2, 'f': 64},
		{'r': 2, 'f': 128},
		{'r': 2, 'f': 256},
		{'r': 2, 'f': 512}
	], 
	'b': False
}

model = ResNet(r18_config)

Or you can use one of the predefined configurations, or variants:

from convnets.models import ResNet, ResNetConfig

model = ResNet(ResNetConfig.r18)

You can find the implementation of each model and configuration examples in the convnets/models directory.

Training API

If you want to train a model in your notebooks, you can use our fit function:

form convnets.train import fit 

hist = fit(model, dataloader, optimizer, criterion, metrics, max_epochs)

You can use any Pytorch model. You will need to define the Pytorch dataloader, optimizer and criterion. For the metrics, the function expects a dict with the name of the metric as key and the metric function as value. The metric function must receive the model output and the target and return a scalar value. You can find some examples in convnets/metrics. The max_epochs parameter is the maximum number of epochs to train the model. The function will return a dict with the training history.

Additionally, we offer a training script that you can execute from the command line.

python scripts/train.py <path_to_config_file>

You will have to pass the path to a yaml file with the configuration for your training, including the model, optimizer, criterion, metrics, dataloader, etc. You can find some examples in the configs directory (which are timm and pytorch-lightning compatible).

We also offer Pytorch Lightning interoperability.

Metadata

Release files for convnets 0.2.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for convnets 0.2.9
File Size Uploaded Provenance Actions
convnets-0.2.9.tar.gz 15.3 kB Without provenance Details for convnets-0.2.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for convnets 0.2.9
File Interpreter ABI Platform Actions
convnets-0.2.9-py3-none-any.whl Python 3 none any Details for convnets-0.2.9-py3-none-any.whl

Total release size: 37.1 kB

Release files / convnets-0.2.9.tar.gz

Download URL convnets-0.2.9.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ff26ff0ec54d812d1823068d05c40804786f8fb01c7a17a38a0249687cf825e2
BLAKE2b-256 checksum
How to use checksums
85ed4542ca9d8809ab52ee1492fb95dd440c7e0da1a883c4331f76c61c898ef5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.6 Linux/5.19.0-35-generic

Release files / convnets-0.2.9-py3-none-any.whl

Download URL convnets-0.2.9-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2b68ca8323de965d65ef73c901a6a92b47c12de119583f450cd7e3d309e3355
BLAKE2b-256 checksum
How to use checksums
13ac47ed745edfc1b5d0b21be4316b36491cd57afff6a5b592a5656f8c5c6f92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.6 Linux/5.19.0-35-generic

Security for convnets 0.2.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page