title
Flask and Deep Learning Keras/TensorFlow Web Services (13.1)

description
To make use of your neural network in a website or other external application you will typically wrap the neural network in a RESTful application programming interface (API) through HTTP or HTTPS. This video shows how to use Flask to expose your Keras neural network as a RESTful API service. Code for This Video: https://github.com/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_13_01_flask.ipynb Data for this Video: https://data.heatonresearch.com/data/t81-558/index.html Course Homepage: https://sites.wustl.edu/jeffheaton/t81-558/ Follow Me/Subscribe: https://www.youtube.com/user/HeatonResearch https://github.com/jeffheaton https://twitter.com/jeffheaton Support Me on Patreon: https://www.patreon.com/jeffheaton

detail
{'title': 'Flask and Deep Learning Keras/TensorFlow Web Services (13.1)', 'heatmap': [], 'summary': 'Tutorial series covers deploying scikit-learn model or keras neural network using flask for python, recommends gunicorn for production, performing data analysis, integrating json with python for web application, emphasizing good error handling in production applications, and using neural networks for image recognition, including training with mobilenet and decoding predictions for image recognition.', 'chapters': [{'end': 357.2, 'segs': [{'end': 33.077, 'src': 'embed', 'start': 1.138, 'weight': 0, 'content': [{'end': 2.239, 'text': 'Hi, this is Jeff Heaton.', 'start': 1.138, 'duration': 1.101}, {'end': 5.521, 'text': 'Welcome to Applications of Deep Neural Networks with Washington University.', 'start': 2.259, 'duration': 3.262}, {'end': 22.451, 'text': "In this video we're going to see how you can use something called Flask for Python and that will allow you to deploy a scikit-learn model or a neural network that you created with Keras to your own web server or even to the cloud.", 'start': 6.001, 'duration': 16.45}, {'end': 28.573, 'text': 'For the latest on my AI course and projects, click subscribe and the bell next to it to be notified of every new video.', 'start': 22.827, 'duration': 5.746}, {'end': 33.077, 'text': 'Now Flask is one of those things that does not work particularly well in a Jupyter Notebook.', 'start': 28.673, 'duration': 4.404}], 'summary': 'Flask enables deploying ml models to web servers, not ideal for jupyter notebook.', 'duration': 31.939, 'max_score': 1.138, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug1138.jpg'}, {'end': 129.787, 'src': 'embed', 'start': 99.419, 'weight': 1, 'content': [{'end': 102.72, 'text': 'So Gunicorn, this is the more production ready.', 'start': 99.419, 'duration': 3.301}, {'end': 111.123, 'text': "So if you're truly going to deploy this in some way, I suggest using Gunicorn because it works very well handling simultaneous requests coming in.", 'start': 102.84, 'duration': 8.283}, {'end': 116.984, 'text': "So, if you need to run two neural networks at the same time because you've got two requests coming in from potentially two different customers,", 'start': 111.183, 'duration': 5.801}, {'end': 119.165, 'text': "you don't want to have to wait till one ends,", 'start': 116.984, 'duration': 2.181}, {'end': 124.846, 'text': 'like you would have to do because of the global instruction lock that is inherent in Python and therefore in Flask.', 'start': 119.165, 'duration': 5.681}, {'end': 129.787, 'text': 'I do have a link to a Flask quick start if you want to read through that, not specific to neural networks.', 'start': 125.126, 'duration': 4.661}], 'summary': 'Gunicorn is recommended for production deployment due to its ability to handle simultaneous requests, avoiding the need to wait for global instruction lock in flask.', 'duration': 30.368, 'max_score': 99.419, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug99419.jpg'}, {'end': 163.058, 'src': 'embed', 'start': 136.669, 'weight': 3, 'content': [{'end': 142.411, 'text': "If I were one of these crazy internet channels where I'm blowing things up, I would say don't try this at home.", 'start': 136.669, 'duration': 5.742}, {'end': 144.552, 'text': "But you won't lose a finger doing this, I guarantee.", 'start': 142.511, 'duration': 2.041}, {'end': 148.113, 'text': 'You create a new Flask instance, and this is important.', 'start': 144.652, 'duration': 3.461}, {'end': 153.835, 'text': "This means it's going to service the root of the URL, and it's going to run off of localhost.", 'start': 148.453, 'duration': 5.382}, {'end': 159.897, 'text': "So if you were running this in a production environment, you'd probably have www.heatonresearch.com or whatever your name is.", 'start': 154.295, 'duration': 5.602}, {'end': 163.058, 'text': 'and it would probably be on 80 and not 9,000.', 'start': 160.717, 'duration': 2.341}], 'summary': 'Creating a new flask instance to serve the root url on localhost, not in a production environment.', 'duration': 26.389, 'max_score': 136.669, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug136669.jpg'}, {'end': 282.84, 'src': 'embed', 'start': 242.082, 'weight': 4, 'content': [{'end': 246.504, 'text': "and now we're going to run the miles per gallon neural network that we created earlier.", 'start': 242.082, 'duration': 4.422}, {'end': 251.126, 'text': "we're gonna train one, save it to a binary file, to an h5 file,", 'start': 246.504, 'duration': 4.622}, {'end': 258.93, 'text': "load it and we're going to create a flask application that expects input like this you give it number of cylinders, displacement,", 'start': 251.126, 'duration': 7.804}, {'end': 262.432, 'text': 'horsepower and and it will predict how many miles per gallon that car is going to have.', 'start': 258.93, 'duration': 3.502}, {'end': 267.614, 'text': 'Now, I will show you how to access this web service in several different ways.', 'start': 262.712, 'duration': 4.902}, {'end': 269.595, 'text': "We're going to see how to access it in pure Python.", 'start': 267.815, 'duration': 1.78}, {'end': 274.038, 'text': "We're going to see how to access it also from a very powerful utility called Postman.", 'start': 269.676, 'duration': 4.362}, {'end': 278.538, 'text': 'Postman lets me just literally copy and paste that into it and send it to the web service.', 'start': 274.656, 'duration': 3.882}, {'end': 281.019, 'text': "First, let's see what the web service actually looks like.", 'start': 278.678, 'duration': 2.341}, {'end': 282.84, 'text': 'Now, this is the training.', 'start': 281.199, 'duration': 1.641}], 'summary': 'Running a neural network to predict miles per gallon and accessing the web service in different ways.', 'duration': 40.758, 'max_score': 242.082, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug242082.jpg'}], 'start': 1.138, 'title': 'Deploying neural networks with flask for python', 'summary': 'Explains deploying scikit-learn model or keras neural network using flask for python, recommends gunicorn for production, covers deploying a flask application for predicting miles per gallon, and accessing the web service in different ways.', 'chapters': [{'end': 119.165, 'start': 1.138, 'title': 'Flask for python: deploying neural networks', 'summary': 'Explains how to use flask for python to deploy scikit-learn model or a neural network created with keras to a web server or the cloud, and why gunicorn is recommended for production.', 'duration': 118.027, 'highlights': ['Flask allows deploying scikit-learn model or Keras neural network to web server or cloud Flask enables deployment of scikit-learn model or Keras neural network to a web server or cloud, facilitating the creation of API endpoints for receiving and servicing HTTP/HTTPS requests.', 'Gunicorn is recommended for production deployment Gunicorn is suggested for production deployment due to its capability in handling simultaneous requests, making it suitable for running multiple neural networks servicing multiple requests.', 'Flask is not intended for production but commonly used Flask is a development platform not intended for production, though it is frequently used in production environments, it is recommended to use Gunicorn for production deployments.']}, {'end': 357.2, 'start': 119.165, 'title': 'Flask application for neural network', 'summary': 'Covers deploying a flask application to run a neural network on a local instance, training a neural network for predicting miles per gallon, and accessing the web service in different ways.', 'duration': 238.035, 'highlights': ['Creating and running a Flask instance to service the root URL and running off localhost, typically on port 9000 for local deployment. Setting up a Flask instance to serve the root URL off localhost, often deployed on port 9000 for local instances.', 'Training a neural network to predict miles per gallon, saving it to an H5 file, and creating a Flask application to accept input parameters and predict the miles per gallon for a car. Training a neural network for predicting miles per gallon, saving it to an H5 file, and creating a Flask application to accept input and make predictions.', 'Demonstrating various ways to access the web service, including using pure Python and the utility Postman for sending requests to the web service. Showing different methods to access the web service, such as using pure Python and the Postman utility for sending requests.']}], 'duration': 356.062, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug1138.jpg', 'highlights': ['Flask enables deployment of scikit-learn model or Keras neural network to a web server or cloud, creating API endpoints for HTTP/HTTPS requests.', 'Gunicorn is recommended for production deployment due to its capability in handling simultaneous requests.', 'Flask is commonly used in production environments, but it is recommended to use Gunicorn for production deployments.', 'Setting up a Flask instance to serve the root URL off localhost, often deployed on port 9000 for local instances.', 'Training a neural network for predicting miles per gallon, saving it to an H5 file, and creating a Flask application to accept input and make predictions.', 'Showing different methods to access the web service, such as using pure Python and the Postman utility for sending requests.']}, {'end': 770.703, 'segs': [{'end': 445.228, 'src': 'embed', 'start': 413.645, 'weight': 0, 'content': [{'end': 414.886, 'text': 'Neural networks do much the same.', 'start': 413.645, 'duration': 1.241}, {'end': 418.628, 'text': 'So you need to be careful outside of the range of neural networks.', 'start': 415.026, 'duration': 3.602}, {'end': 420.489, 'text': 'This I also use to test it.', 'start': 419.008, 'duration': 1.481}, {'end': 423.631, 'text': "So let's go ahead and run this just to see the result.", 'start': 420.569, 'duration': 3.062}, {'end': 427.954, 'text': "so this is a car that we're going to test it with, and that's what our output result is.", 'start': 424.131, 'duration': 3.823}, {'end': 435.34, 'text': "we'd like to be able to get the same value through the web application and the web application will start it from the command prompt in a moment.", 'start': 427.954, 'duration': 7.386}, {'end': 438.062, 'text': 'but this is this is what it looks like.', 'start': 435.34, 'duration': 2.722}, {'end': 441.044, 'text': 'so here is the expected values.', 'start': 438.062, 'duration': 2.982}, {'end': 445.228, 'text': "that's that little map that we generated back in the source code and notice, here's the route.", 'start': 441.044, 'duration': 4.184}], 'summary': 'Testing neural networks for car data, aiming for consistent results.', 'duration': 31.583, 'max_score': 413.645, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug413645.jpg'}, {'end': 471.778, 'src': 'embed', 'start': 447.089, 'weight': 1, 'content': [{'end': 452.914, 'text': "later on, when we create a full-blown web application and not just an api endpoint, we're going to have several of these endpoints.", 'start': 447.089, 'duration': 5.825}, {'end': 456.856, 'text': 'Some will be GUI, some will be the backend API.', 'start': 453.674, 'duration': 3.182}, {'end': 458.377, 'text': 'This is calculate miles per gallon.', 'start': 456.956, 'duration': 1.421}, {'end': 460.799, 'text': 'So what we now need to do is we deal with JSON.', 'start': 458.577, 'duration': 2.222}, {'end': 464.201, 'text': 'JSON is essentially JavaScript object notation.', 'start': 461.039, 'duration': 3.162}, {'end': 468.944, 'text': 'What is really cool about Python is Python uses nearly the same syntax as JSON.', 'start': 464.601, 'duration': 4.343}, {'end': 471.778, 'text': 'This is essentially JSON up here.', 'start': 469.637, 'duration': 2.141}], 'summary': 'Plan to create multiple web endpoints, including gui and backend api. python syntax closely matches json.', 'duration': 24.689, 'max_score': 447.089, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug447089.jpg'}, {'end': 518.445, 'src': 'embed', 'start': 491.551, 'weight': 2, 'content': [{'end': 495.273, 'text': "I mean, you don't want to retrain the model every time your web application boots up.", 'start': 491.551, 'duration': 3.722}, {'end': 497.274, 'text': 'For one thing, neural networks are stochastic.', 'start': 495.593, 'duration': 1.681}, {'end': 498.635, 'text': 'You might get a different result each time.', 'start': 497.294, 'duration': 1.341}, {'end': 500.332, 'text': 'That drives your customers crazy.', 'start': 498.971, 'duration': 1.361}, {'end': 505.235, 'text': "If every, why am I getting a different miles per gallon? Oh yeah, we must've rebooted the server.", 'start': 500.572, 'duration': 4.663}, {'end': 506.196, 'text': "No, don't do that.", 'start': 505.596, 'duration': 0.6}, {'end': 508.458, 'text': 'Trust me, I work for the life insurance industry.', 'start': 506.536, 'duration': 1.922}, {'end': 510.639, 'text': 'Our clients would not be happy with that answer.', 'start': 508.558, 'duration': 2.081}, {'end': 518.445, 'text': "Now, when we get a request in on API miles per gallon, I usually put all my end points under API and we're only accepting posts.", 'start': 510.999, 'duration': 7.446}], 'summary': 'Retraining neural networks on web boot-up leads to stochastic results, frustrating customers. endpoints under api only accept posts.', 'duration': 26.894, 'max_score': 491.551, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug491551.jpg'}, {'end': 570.833, 'src': 'embed', 'start': 547.788, 'weight': 3, 'content': [{'end': 556.358, 'text': "you'll have requests coming in at all hours and you will have IT professionals who are not as versed in data science or machine learning as you receiving requests.", 'start': 547.788, 'duration': 8.57}, {'end': 562.744, 'text': "If your program just blows up because some client sent in a bad number, they'll call you or they'll call somebody on your team.", 'start': 556.658, 'duration': 6.086}, {'end': 568.71, 'text': 'Good error messages are the best antidote against late night pager calls and cell phone calls.', 'start': 562.864, 'duration': 5.846}, {'end': 570.833, 'text': "Believe me, I've gotten many of them in my career.", 'start': 568.971, 'duration': 1.862}], 'summary': 'Good error messages prevent late-night pager calls and cell phone calls, reducing disruptions for it professionals.', 'duration': 23.045, 'max_score': 547.788, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug547788.jpg'}, {'end': 632.912, 'src': 'embed', 'start': 605.359, 'weight': 4, 'content': [{'end': 609.825, 'text': 'So, unless you want errors propagating that look unprofessional.', 'start': 605.359, 'duration': 4.466}, {'end': 614.732, 'text': "so Python hard errors, try to always guard against that so that you're checking for that.", 'start': 609.825, 'duration': 4.907}, {'end': 616.555, 'text': 'Just good production practice.', 'start': 614.892, 'duration': 1.663}, {'end': 618.417, 'text': 'I check to see how many errors I have.', 'start': 616.815, 'duration': 1.602}, {'end': 625.886, 'text': "And if there are errors, Then what I'm going to do is return them as another JSON message.", 'start': 618.898, 'duration': 6.988}, {'end': 628.128, 'text': 'So you always want to put some sort of ID here.', 'start': 626.386, 'duration': 1.742}, {'end': 629.089, 'text': "I'm just putting a GUID.", 'start': 628.168, 'duration': 0.921}, {'end': 630.31, 'text': "We'll see what that looks like in a moment.", 'start': 629.109, 'duration': 1.201}, {'end': 632.912, 'text': 'But every transaction needs to have a globally unique ID.', 'start': 630.41, 'duration': 2.502}], 'summary': 'Python production practice: guard against errors, return as json message, ensure globally unique transaction id.', 'duration': 27.553, 'max_score': 605.359, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug605359.jpg'}], 'start': 357.2, 'title': 'Web application data analysis and error handling', 'summary': 'Discusses performing data analysis, neural networks, and integrating json with python for web application. it also emphasizes the importance of good error handling in production applications, showcasing its impact on reducing late-night calls and maintaining professional standards.', 'chapters': [{'end': 508.458, 'start': 357.2, 'title': 'Web application data analysis and neural networks', 'summary': 'Discusses performing data analysis to ensure data accuracy, avoiding out-of-range inputs for neural networks, and integrating json with python for a web application to calculate miles per gallon.', 'duration': 151.258, 'highlights': ['Performing data analysis to ensure data accuracy and avoid out-of-range inputs for neural networks. Emphasizes the importance of analyzing data to prevent errors and ensuring inputs fall within the range suitable for neural networks.', 'Integrating JSON with Python for a web application to calculate miles per gallon. Explains the integration of JSON with Python and the significance of using valid JSON syntax in Python for web applications.', 'Highlighting the need to avoid retraining the model each time the web application boots up to maintain consistent results. Stresses the importance of avoiding retraining neural network models to prevent inconsistent results and customer dissatisfaction.']}, {'end': 770.703, 'start': 508.558, 'title': 'Best practices for handling errors in production', 'summary': 'Emphasizes the importance of good error handling in production applications, highlighting its impact on reducing late-night calls and maintaining professional standards, and showcasing the process of handling errors and providing descriptive messages to avoid unprofessional errors propogation.', 'duration': 262.145, 'highlights': ['Importance of Good Error Messages Emphasizes the impact of good error messages in reducing late-night calls and maintaining professional standards.', 'Handling Errors in Production Applications Showcases the process of handling errors and providing descriptive messages to avoid unprofessional errors propogation.', 'Utilizing Postman for API Testing Demonstrates the usage of Postman for testing APIs and observing the responses.', 'Creating Numpy Array for Predictions Illustrates the creation of a numpy array for predictions, with seven inputs and the formation of response in Python object notation.', 'Running the MPG Server Details the process of running the MPG server and handling potential firewall errors.']}], 'duration': 413.503, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug357200.jpg', 'highlights': ['Performing data analysis to ensure data accuracy and avoid out-of-range inputs for neural networks.', 'Integrating JSON with Python for a web application to calculate miles per gallon.', 'Highlighting the need to avoid retraining the model each time the web application boots up to maintain consistent results.', 'Importance of Good Error Messages Emphasizes the impact of good error messages in reducing late-night calls and maintaining professional standards.', 'Handling Errors in Production Applications Showcases the process of handling errors and providing descriptive messages to avoid unprofessional errors propagation.']}, {'end': 1060.429, 'segs': [{'end': 889.492, 'src': 'embed', 'start': 857.1, 'weight': 1, 'content': [{'end': 859.401, 'text': 'and it recognizes a thousand different images.', 'start': 857.1, 'duration': 2.301}, {'end': 864.482, 'text': 'And what I do here is basically I bring up MobileNet.', 'start': 860.001, 'duration': 4.481}, {'end': 867.463, 'text': "I'm actually not loading a saved neural network.", 'start': 864.862, 'duration': 2.601}, {'end': 869.364, 'text': 'This is inside of Keras actually.', 'start': 867.503, 'duration': 1.861}, {'end': 872.085, 'text': "So this, that's why we don't have to train this network.", 'start': 869.464, 'duration': 2.621}, {'end': 873.025, 'text': "It's transfer learning.", 'start': 872.125, 'duration': 0.9}, {'end': 874.005, 'text': "It's already there for us.", 'start': 873.065, 'duration': 0.94}, {'end': 875.986, 'text': 'The route is going to be API image.', 'start': 874.345, 'duration': 1.641}, {'end': 879.587, 'text': "We're going to check to make sure that an image was actually posted.", 'start': 876.346, 'duration': 3.241}, {'end': 880.627, 'text': 'If not, we have an error.', 'start': 879.647, 'duration': 0.98}, {'end': 882.768, 'text': 'This is a multi-part upload.', 'start': 880.827, 'duration': 1.941}, {'end': 889.492, 'text': "So, if you've ever done HTTP programming, web programming Anytime you upload a file to a web application.", 'start': 882.828, 'duration': 6.664}], 'summary': 'Mobilenet in keras recognizes 1000 images. transfer learning used for image api upload.', 'duration': 32.392, 'max_score': 857.1, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug857100.jpg'}, {'end': 1002.358, 'src': 'embed', 'start': 973.957, 'weight': 0, 'content': [{'end': 977.86, 'text': "And essentially I'm using a picture of my dog from the class page.", 'start': 973.957, 'duration': 3.903}, {'end': 979.121, 'text': 'So you have hickory.jpg.', 'start': 977.9, 'duration': 1.221}, {'end': 980.321, 'text': "He's in the images directory.", 'start': 979.161, 'duration': 1.16}, {'end': 984.504, 'text': 'And I am going to go ahead and run that.', 'start': 980.882, 'duration': 3.622}, {'end': 989.107, 'text': 'Make sure that you specify that as a file that does a multi-part upload.', 'start': 984.564, 'duration': 4.543}, {'end': 989.968, 'text': "We'll click send.", 'start': 989.347, 'duration': 0.621}, {'end': 991.829, 'text': "And there's that pred file.", 'start': 990.408, 'duration': 1.421}, {'end': 993.03, 'text': 'that I showed you before.', 'start': 992.129, 'duration': 0.901}, {'end': 994.631, 'text': "It thinks he's a boxer.", 'start': 993.611, 'duration': 1.02}, {'end': 995.853, 'text': "He's an English bulldog.", 'start': 994.671, 'duration': 1.182}, {'end': 1002.358, 'text': "It's not my neural network blame, the creators of MobileNet, although boxers, bulldogs, he's not any of these.", 'start': 996.373, 'duration': 5.985}], 'summary': "Uploading hickory.jpg for classification as a boxer, but it's an english bulldog.", 'duration': 28.401, 'max_score': 973.957, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug973957.jpg'}, {'end': 1042.252, 'src': 'embed', 'start': 1016.391, 'weight': 2, 'content': [{'end': 1025.598, 'text': 'You can also send this image request with python with any programming language really like i said, this is the relatively simple command to do that.', 'start': 1016.391, 'duration': 9.207}, {'end': 1027.721, 'text': "you're going to post it to images.", 'start': 1025.598, 'duration': 2.123}, {'end': 1030.463, 'text': 'this is that key part right here.', 'start': 1027.721, 'duration': 2.742}, {'end': 1034.205, 'text': "that's how you pop a jpeg over python and send it in.", 'start': 1030.463, 'duration': 3.742}, {'end': 1035.087, 'text': 'it is named image.', 'start': 1034.205, 'duration': 0.882}, {'end': 1042.252, 'text': "that's critical, because that is the label that my program is expecting on the receiving side.", 'start': 1035.087, 'duration': 7.165}], 'summary': "Sending image request with python, critical label 'image' for program expectation.", 'duration': 25.861, 'max_score': 1016.391, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug1016391.jpg'}], 'start': 771.283, 'title': 'Using neural networks for image recognition', 'summary': 'Demonstrates using neural networks for image recognition, including sending images through http, training with mobilenet, and decoding predictions, ultimately recognizing a dog image as a boxer with a 23 miles per gallon prediction.', 'chapters': [{'end': 1060.429, 'start': 771.283, 'title': 'Neural network image recognition', 'summary': 'Demonstrates the process of using neural networks for image recognition, including sending images through http, training with mobilenet, and decoding predictions, ultimately resulting in recognizing a dog image as a boxer with a 23 miles per gallon prediction.', 'duration': 289.146, 'highlights': ['The process involves using MobileNet, a pre-trained neural network, to recognize a thousand different images and predict the content of an uploaded image. MobileNet is utilized for recognizing a wide range of images, making predictions based on a pre-trained neural network.', 'The chapter details the process of sending an image through HTTP, resizing it, and decoding the predictions, ultimately recognizing a dog image as a boxer. The process involves sending an image through HTTP, resizing and preprocessing it, and decoding the predictions, ultimately recognizing a dog image as a boxer.', 'The demonstration includes sending images through Python and other programming languages using a relatively simple command. The chapter demonstrates how to send image requests through Python and other programming languages using a relatively simple command.']}], 'duration': 289.146, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/H73m9XvKHug/pics/H73m9XvKHug771283.jpg', 'highlights': ['The chapter details the process of sending an image through HTTP, resizing it, and decoding the predictions, ultimately recognizing a dog image as a boxer.', 'The process involves using MobileNet, a pre-trained neural network, to recognize a thousand different images and predict the content of an uploaded image.', 'The demonstration includes sending images through Python and other programming languages using a relatively simple command.']}], 'highlights': ['Flask enables deployment of scikit-learn model or Keras neural network to a web server or cloud, creating API endpoints for HTTP/HTTPS requests.', 'Gunicorn is recommended for production deployment due to its capability in handling simultaneous requests.', 'Integrating JSON with Python for a web application to calculate miles per gallon.', 'Importance of Good Error Messages Emphasizes the impact of good error messages in reducing late-night calls and maintaining professional standards.', 'The chapter details the process of sending an image through HTTP, resizing it, and decoding the predictions, ultimately recognizing a dog image as a boxer.']}