element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
Documents Review - Pynq Z2 Road Test
  • Blog
  • RoadTest Forum
  • Documents
  • RoadTests
  • Reviews
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RoadTests & Reviews to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: sambit1991
  • Date Created: 26 Jul 2019 1:16 PM Date Created
  • Last Updated Last Updated: 6 Oct 2021 10:06 PM
  • Views 720 views
  • Likes 0 likes
  • Comments 2 comments
Related
Recommended

Review - Pynq Z2 Road Test

Okay, so element14 gave me a Pynq Z2 and I tried running some simple applications on it to see what is all the hype about.

 

1) CIFAR 10 using pre-trained binary neural networks - I use my own images and change the code a little to see performance comparison between hardware accelerated inference and software inference:

# take the above pieces and put together into a function

 

#======================================================== CODE ========================================================================================================#

import bnn

from PIL import Image

import numpy as np

import time

 

 

hw_classifier = bnn.CnvClassifier(bnn.NETWORK_CNVW1A1,'cifar10',bnn.RUNTIME_HW)

sw_classifier = bnn.CnvClassifier(bnn.NETWORK_CNVW1A1,'cifar10',bnn.RUNTIME_SW)

 

 

im_name = '/home/xilinx/jupyter_notebooks/SAMBIT_DATA/car' + str(4) + '.jpg'

print("Classifying image : {0}".format(im_name))

im = Image.open(im_name)

im       

def classify_images_cifar10():

    """

    Function classifies a series of images using the hardware classifier

    platform : hw -> hardware

                sw -> software

    """

   

    print("Available classes")

    print(hw_classifier.classes)

   

    print ("========================== hardware classifications ==============================")

    for i in range(1,10):

        im_name = '/home/xilinx/jupyter_notebooks/SAMBIT_DATA/car' + str(i) + '.jpg'

        print("Classifying image : {0}".format(im_name))

        im = Image.open(im_name)

        im

       

        class_out=hw_classifier.classify_image(im)

        print("Class number: {0}".format(class_out))

        print("Class name: {0}".format(hw_classifier.class_name(class_out)))

       

   

    print("======================== software classifications ===============================")

    for i in range(1,10):

        im_name = '/home/xilinx/jupyter_notebooks/SAMBIT_DATA/car' + str(i) + '.jpg'

        print("Classifying image : {0}".format(im_name))

        im = Image.open(im_name)

        im

       

        class_out = sw_classifier.classify_image(im)

        print("Class number: {0}".format(class_out))

        print("Class name: {0}".format(sw_classifier.class_name(class_out)))

   

    return im

       

 

 

if __name__ == '__main__':

    im = classify_images_cifar10()

    im

   

   

 

 

Here is the output:

 

image

 

Problems:

 

1) As you can see in the code:

        im_name = '/home/xilinx/jupyter_notebooks/SAMBIT_DATA/car' + str(i) + '.jpg'

        print("Classifying image : {0}".format(im_name))

        im = Image.open(im_name)

        im

 

I expected this to first show the image that I am classifying and then show classifcation result. But, the images are not displayed.

The code seems to be correct since it is just an adaptation of:

image

 

This works, but in the loop, it does not.

 

2) The accuracy is just above 50%, as can be seen in the output, only 4 images were classified correctly out of 9 (the last output is not visible here).

 

3) Development resources and documentation:

- I haven't seen a more unorganized and confused documentation for an embedded development platform EVER!!! It is absolutely incoherent and mixed up.

- There isn't even an API guide that describes all APIs, parameters and examples.

- The documentation at best, just glances over what Pynq has, never really mentioning how to.

- Even a simple LED blink app will take about 30 mins of scourging through examples - I don't like learning how to use an API by reading examples.

- Even the BNN/ FINN repository does not mention anything about how to build a BNN, just presents some examples and expects users to just tweak some code and there and be happy. I am not!!!!

- Overlay design, a very key concept has just been hinted at, never showing an end-to-end example. May be this is enough for an experience FPGA developer, but for someone like me who is trying to figure out Pynq and FPGA design, it makes absolutely no sense.

I found better resources for overlay design on the internet than in the documentation for Pynq.

- Development environment : Jupyter is okay just for fun, NOT for serious and large code development!! Especially with all the new overlay packages and others (minus the documentation), I would like to have the support of intellisense like in a professional IDE like PyCharm or Eclipse.

So far, I could not find any.

 

What I like:

 

1) Quick prototyping for existing overlays and libraries

2) Easy file transfer via samba

3) Pretty impressive hardware performance for such low cost.

 

 

I shall try some more applications and may be an overlay design, since I have some more time on hand.

Attachments:
image
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • neuromodulator
    neuromodulator over 5 years ago +3
    If you are having trouble you could ask other roadtesters or in digilents forum for help. The web editor supports many formatting options, you could use headers, write code in special code sections, add…
  • sambit1991
    sambit1991 over 5 years ago +1
    I shall put it into a proper review format.
  • sambit1991
    sambit1991 over 5 years ago

    I shall put it into a proper review format.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • neuromodulator
    neuromodulator over 5 years ago

    If you are having trouble you could ask other roadtesters or in digilents forum for help. The web editor supports many formatting options, you could use headers, write code in special code sections, add a table of contents, etc to make the text easier to read. Also it may be a good plan to check other roadtests so that you get a better picture on how they are usually written.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube