element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
Design for a Cause - Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Design for a Cause - Design Challenge
  • More
  • Cancel
Design for a Cause - Design Challenge
Blog Audio4Vision #8 - Deploying the Show and Tell model on a server
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: pranjalranjan299
  • Date Created: 13 Sep 2018 2:46 PM Date Created
  • Views 623 views
  • Likes 3 likes
  • Comments 0 comments
Related
Recommended

Audio4Vision #8 - Deploying the Show and Tell model on a server

pranjalranjan299
pranjalranjan299
13 Sep 2018

Welcome to our 8th blog post! Today, we'll be uploading and deploying our Show and Tell model on a local server, uploading an image and getting the caption.

 

In order to create a web application, we'll be using a Python microframework called Flask. Flask is a well-known and well-documented micro web framework which acts as a backend for any website. Many large websites like Pinterest, LinkedIn, etc. use Flask in their backend.

 

Flask mainly revolves around a python file, which contains all the routing logic, and for our purpose will also contain the model loading and prediction logic. It has a bunch of helper html files, called templates. These templates are basically individual web pages on the website, and can be assigned to specific routes in the python file.

 

This is how the main folder looks:

image

And here's how the file structure looks:

image

 

In order to start the server, we simply execute the main.py file.

image

We go to the site as shown in the image (http://127.0.0.1:5000/) (you can also use "localhost:5000" without the quotes).

image

We upload the file of our choice and it displays the caption. We tried it on a couple of images:

 

image

 

When we press the "Upload" button on the homepage, the code sends a POST request along with an image to the flask server. The server then takes the image, puts it in storage, evaluates the model over said image, and displays the output prediction. The source html is programmatically written to display the image as well as the top 3 captions along with their predictions.

 

This was manually uploading the images to the server. What the MKR1000 can do is connect to the Flask server via WiFi, send a POST request containing the image that it has stored in its SD card, wait for the evaluation, get the caption back in a string format.

 

Here's the Github repo.

 

That's all for this blog. The next blog will be all about the speaker setup, configuration and testing.

Thanks for reading this blog, the next one will be up in no time!

  • Sign in to reply
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