# fpgaConvNet and PYNQ

**URL:** <https://discuss.pynq.io/t/fpgaconvnet-and-pynq/6182>\
**Category:** Community corner\
**Created:** [October 12, 2023, 3:23pm UTC](https://discuss.pynq.io/t/fpgaconvnet-and-pynq/6182 "2023-10-12T15:23:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eneriz-daniel](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/eneriz-daniel/32/1654_2.png) [@eneriz-daniel](https://discuss.pynq.io/u/eneriz-daniel)\
**Post date:** [October 12, 2023, 3:23pm UTC](https://discuss.pynq.io/t/fpgaconvnet-and-pynq/6182/1 "2023-10-12T15:23:51Z")

</div>

Hello there!

In this post I want to introduce a PYNQ driver I’ve created for [fpgaConvNet](https://alexmontgomerie.github.io/fpgaconvnet-website/). fpgaConvNet is a project that aims to accelerate Convolutional Neural Networks (CNNs) on FPGAs with state-of-the-art performance and efficiency. If you want to learn more about it, check the[tutorials they have](https://github.com/AlexMontgomerie/fpgaconvnet-tutorial).

The driver aims to bring the power of fpgaConvNet to the PYNQ framework, easing the deployment of CNNs on PYNQ boards. **The driver is available on [GitHub](https://github.com/eneriz-daniel/fpgaconvnet-PYNQ),** and it includes a [Jupyter notebook](https://github.com/eneriz-daniel/fpgaconvnet-PYNQ/blob/master/PYNQ-deployment-tutorial.ipynb) to show how to use it. Basically, its functionality is the following:

```python

from pynq import Overlay
from fpgaconvnet_pynq_driver import *

overlay = Overlay('bitstream.bit')

fpgaconvnet_ip = overlay.fpgaconvnet_ip_0
fpgaconvnet_ip.load_partition('partitions.json', 0)

Y = fpgaconvnet_ip.run(X)

```

The driver also includes a function, [`fpgaconvnet_ip.test_performance()`](https://github.com/eneriz-daniel/fpgaconvnet-PYNQ/blob/81dcb2c62ea9f65f02340498666da95c43ad1485/fpgaconvnet_pynq_driver.py#L431C18-L431C18), that characterizes the latency and throughput of the accelerator. Also, if it is run in a [PMBus-enabled board](https://discuss.pynq.io/t/how-to-measure-power-consumption/523/6), it uses the [PYNQ PMBus API](https://pynq.readthedocs.io/en/v3.0.0/pynq_libraries/pmbus.html) to measure the power consumption of the accelerator and calculate the energy per inference.

Any feedback is welcome! I hope you find it useful.

Cheers,

Daniel
