Neurocorgi-sdk

Latest version: v2.0.2

Safety actively analyzes 622315 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

2.0.0

💡 Highlights

We are delighted to annonce the new release of NeuroCorgi SDK 🤗
This version introduces a complete refactor of the SDK to use the **NeuroCorgi model** in your object detection, segmentation or classification applications.
We would like to thank everyone who contributed to this release!

🤔 What's new?

We changed the way of using `NeuroCorgiNet` in the Python scripts.

**Before**
python
from neurocorgi_sdk.models import NeuroCorgiNet, NeuroCorgiNet_torch

Load model for inference with N2D2
model = NeuroCorgiNet([1, 3, 224, 224], weights_dir="data/imagenet_weights")

Load model for inference with N2D2 via the Pytorch interoperability
model = NeuroCorgiNet_torch([1, 3, 224, 224], weights_dir="data/imagenet_weights")


In the previous version, n2d2 was required to load and use the NeuroCorgi model for every configuration.
So we decided to propose to the users a full Pytorch user experience with the model, in order to reduce the number of dependencies.
Of course, it is still possible to use the n2d2 configuration as before.

**After**
python
from neurocorgi_sdk import NeuroCorgiNet
from neurocorgi_sdk.models import NeuroCorgiNet_n2d2, NeuroCorgiNet_n2d2_torch if n2d2 installed

Load model for inference with Pytorch
model = NeuroCorgiNet("data/neurocorginet_imagenet.safetensors")

Load model for inference with N2D2
model = NeuroCorgiNet_n2d2([1, 3, 224, 224], weights_dir="data/imagenet_weights")

Load model for inference with N2D2 via the Pytorch interoperability
model = NeuroCorgiNet_n2d2_torch([1, 3, 224, 224], weights_dir="data/imagenet_weights")


We also introduced a new data transformation named `ToNeuroCorgiChip`.
python
from PIL import Image
import requests
from neurocorgi_sdk.transforms import ToNeuroCorgiChip

image = Image.open(requests.get("https://github.com/CEA-LIST/neurocorgi_sdk/raw/master/neurocorgi_sdk/assets/corgi.jpg", stream=True).raw)
tensor_input = ToNeuroCorgiChip()(image)


Indeed, the NeuroCorgi circuit requires to provide unsigned 8-bit inputs. To respect this condition, inputs provided to `NeuroCorgiNet` must be between 0 and 255. So you can use the `ToNeuroCorgiChip` transformation to transform your images in the correct format. (No need to use it with the fakequant version `NeuroCorgiNet_fakequant` though).


Finally, we also added some tests in the SDK as well as CI/CD processes with Github Actions.


🚀 What's coming next?

We are currently working to add more use cases to the SDK examples to show you all the possibilities we can do with NeuroCorgi.
Feel free to propose your own applications, we are excited to see them 🤩

If you have any question, please ask it [here](https://github.com/CEA-LIST/neurocorgi_sdk/issues/new?assignees=&labels=question&projects=&template=question.yaml). We will be happy to help.

1.0.0

💡 Highlights

This version is the first to use the NeuroCorgiNet model, which simulates the behavior of the network frozen on the NeuroCorgi circuit.
You can use this model via N2D2 or Pytorch.

Example of use with N2D2
python
from neurocorgi_sdk.models import NeuroCorgiNet

model = NeuroCorgiNet([1, 3, 224, 224], weights_dir="data/imagenet_weights")


Example of use with Pytorch
python
from neurocorgi_sdk.models import NeuroCorgiNet_torch

model = NeuroCorgiNet_torch([32, 3, 224, 224], weights_dir="data/imagenet_weights")


Several examples are provided to see how to build a nn application with the model.


🚀 What's coming next ?

We are exciting to annonce that we are working on a complete refont of the sdk to provide you the best user experience. 💪

More news coming soon ! 🤗

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.