Project- How to build low-latency deep-learning-based flask app

7 / 17

Understanding the Directory Structure

Let us understand what are all the directories we will be using for app:

enter image description here

The Flask-ZMQ-App-Folder is the main project directory, in which we have:

  • Model-Server-Folder: It contains the virtual environment, model server code, and the requirements.txt file.

    • model-env: The virtual environment for the model server.

    • resnet_model_server.py: This is the file where we import the pre-trained resent50 model, receive the encoded image, and perform the class predictions of the given input image by feeding it to the resnet50 pre-trained model we have imported previously. The top 3 predictions will be returned in the form of JSON object to the client.

    • test_client.py: This acts as a temporary client for our resnet_model_server.py server, in order to check if the communication between both of them is happening properly and if the predictions are received without any issues. Once this is successful, we could modify the code in app.py file so that it acts as the client to resnet_model_server.py.

    • requirements.txt: The list of all the necessary packages along with their corresponding versions, used for the running of resnet_model_server.py.

  • Flask-Server-Folder: It contains the virtual environment, flask server code, and the requirements.txt file.

    • flask-env: The virtual environment for the flask server.

    • app.py: This is the file where we initialize Flask. This acts as the client to the server defined in resnet_model_server.py.

    • requirements.txt: The list of all the necessary packages along with their corresponding versions, used for the running of app.py.

    • static: This folder contains static files, like CSS and images.

    • templates: This folder contains the HTML templates for the web pages we render.


No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...