AI_DL_Assignment / 29. BONUS - Create a Computer Vision API & Web App Using Flask and AWS /8. Running your CV Web App on EC2.html
| <h4><strong>Running Our CV Web App</strong></h4><p><br></p><p><strong>Step 1</strong>: Let's go back to your terminal in our VM or local OS and connect to our EC2 system </p><p><code>ssh -i ~/.ssh/my_aws_key.pem ubuntu@18.224.96.38</code></p><figure><img src="https://udemy-images.s3.amazonaws.com:443/redactor/raw/2019-04-23_05-55-04-055aacf3331c034d10cb070afd33191b.JPG"></figure><p><strong>Step 2: </strong>Check to see if the files we transferred using FileZilla are indeed located on our EC2 Instance. Running <code>ls</code> should display the following files:</p><figure><img src="https://udemy-images.s3.amazonaws.com:443/redactor/raw/2019-04-23_05-55-04-11abbea6c691e37aed4e7ee95c7559d0.JPG"></figure><p><strong>Step 3: </strong>Launch our Web App by running this line:</p><p><code>sudo python3 webapp.py</code></p><figure><img src="https://udemy-images.s3.amazonaws.com:443/redactor/raw/2019-04-23_05-55-04-6eca288bff15051487a40c55bb77c6a1.JPG"></figure><p>If you see the above, Flask is running our CV Web App! Let's go the our web browser and access it:</p><p><strong>Step 4: </strong>Enter the EC2 IP in your web browser and your should see the following.</p><p><strong>Congratulations</strong>! You've just launched a simple Computer Vision API for anyone in the world to use! Let's upload some test images to see our Web App in action!</p><figure><img src="https://udemy-images.s3.amazonaws.com:443/redactor/raw/2019-04-23_05-55-04-467b63c0ea3e8de2a4b9cb0c33db2693.png"></figure><figure><img src="https://udemy-images.s3.amazonaws.com:443/redactor/raw/2019-04-23_05-55-04-1d6c77e1e20a7dd571cefa84d2fd6ea7.png"></figure><figure><img src="https://udemy-images.s3.amazonaws.com:443/redactor/raw/2019-04-23_05-55-04-47742e4675b799abf7c93f81765e6101.png"></figure><figure><img src="https://udemy-images.s3.amazonaws.com:443/redactor/raw/2019-04-23_05-55-04-8d41647668253e2f92f8c4ac6de5d166.png"></figure><p>Awesome!</p><p><strong>Note: </strong></p><ol><li><p>This isn't a production grade Web App, there are many things needed to make this ready for public consumption (mainly in terms of security, scalability and appearance), however as of now, it's perfect to demo friends, colleagues, potential investors etc. </p></li><li><p>To keep our API running constantly launch the python code using this instead:</p></li></ol><p><code>sudo nohup python3 forms.py & screen</code></p><p><br></p><p><strong>Finally, let's deploy our API version of this App and test using Postman.</strong></p> |