Package: neurocorgi-sdk
NeuroCorgi SDKThe NeuroCorgi-SDK is a SDK to use the NeuroCorgi model in your object detection, instance segmentation and classification applications as a feature extractor.This SDK is developed inside the Andante project. For more information about the Andante project, go tohttps://www.andante-ai.eu/.The SDK provides some versions of the NeuroCorgi circuit which can simulate the behaviour of the models on chip. Two versions have been designed from a MobileNetV1 trained and quantized in 4-bit by using theSATmethod inN2D2: one with theImageNetdataset and the second with theCocodataset.NeuroCorgi ASICThe NeuroCorgi ASIC is able to extract features from HD images (1280x720) at 30 FPS with less than 100 mW.NeuroCorgi performance targetFor more information about the NeuroCorgi ASIC, check thepresentationofIvan Miro-Panadesat the International Workshop on Embedded Artificial Intelligence Devices, Systems, and Industrial Applications (EAI).InstallationBefore installing the sdk package, be sure to have the weight files of the NeuroCorgi models to use them with the sdk. Two versions exist for both Coco and ImageNet versions of the circuit.Please choose what you want:For PyTorch integrationFor N2D2 integrationImageNet chipneurocorginet_imagenet.safetensorsimagenet_weights.zipCoco chipneurocorginet_coco.safetensorscoco_weights.zipPlease send an email toIvan Miro-PanadesorVincent Templierto get the files.Via PyPIPip install the sdk package including all requirements in aPython>=3.7environment withPyTorch>=1.8.pip install neurocorgi_sdkFrom SourceTo install the SDK, run in yourPython>=3.7environmentgit clone https://github.com/CEA-LIST/neurocorgi_sdk
cd neurocorgi_sdk
pip install .With DockerIf you wish to work inside a Docker container, you will need to build the image first.To do so, run the commanddocker build --pull --rm -f "docker/Dockerfile" -t neurocorgi:neurocorgi_sdk "."After building the image, start a containerdocker run --name myContainer --gpus=all -it neurocorgi:neurocorgi_sdkGetting StartedUseNeuroCorgiNetdirectly in a Python environment:fromneurocorgi_sdkimportNeuroCorgiNetfromneurocorgi_sdk.transformsimportToNeuroCorgiChip# Load a modelmodel=NeuroCorgiNet("neurocorginet_imagenet.safetensors")# Load and transform an image (requires PIL and requests)image=PIL.Image.open(requests.get("https://github.com/CEA-LIST/neurocorgi_sdk/blob/master/neurocorgi_sdk/assets/corgi.jpg",stream=True).raw)img=ToNeuroCorgiChip()(image)# Use the modeldiv4,div8,div16,div32=model(img)About NeuroCorgi modelThe NeuroCorgi circuit embeds a version of MobileNetV1 which has been trained and quantized in 4-bit. It requires to provide unsigned 8-bit inputs. To respect this condition,inputs provided toNeuroCorgiNetmust be between 0 and 255.You can use theToNeuroCorgiChiptransformation to transform your images in the correct format. (No need to use it with the fakequant versionNeuroCorgiNet_fakequantas the inputs have to be between 0 and 1).Moreover, since the model is fixed on chip it is not possible to modify its parameters.
So it will be impossible to train the models but you can train additional models to plug withNeuroCorgiNetfor your own applications.ExamplesYou can find someexamplesof how to integrate the models in your applications.For instance:ImageNet: useNeuroCorgiNetto perform an ImageNet inference.
You need a local installation of the ImageNet Database to make it work. Once installed somewhere,
you need to modify the ILSVRC2012_root variable to locate the correct directory.Cifar100: useNeuroCorgiNetto perform a transfer learning on CIFAR100 classification challenge.To evaluate NeuroCorgi's performances on other tasks, you should use those scripts as a base inspiration.The TeamThe NeuroCorgi-SDK is a project that brought together several skillful engineers and researchers who contributed to it.This SDK is currently maintained byLilian BillodandVincent Templier.
A huge thank you to the people who contributed to the creation of this SDK:Ivan Miro-Panades,Vincent Lorrain,Inna Kucher,David Briand,Johannes Thiele,Cyril Moineau,Nermine AliandOlivier Bichler.LicenseThis SDK has a CeCill-style license, as found in theLICENSEfile.