Computer Vision News - July 2021
2 Summary Co puter Vision Tool 10 source Python library Streamlit . This works just as any other Python library: it can be installed through pip and allows you to deploy your custom web app in just a few minutes. The only requirement is to have Python 3.6 - Python 3.8 on your machine, and then you will be good to go! Streamlit apps are Python scripts that run from top to bottom. They can be accessed through a sharable link which every time is clicked will execute the script again. It also offers a wide range of widgets that the user can interact with and, once this is done, the script is re-executed and updated very fast. We will see how to use it to create a little app which shows two common computer vision applications: segmentation and object detection. The first will run using a simple K-means algorithm while the second uses pre-downloaded weights and model of the notorious YOLO algorithm. Let’s start with designing our app for the first application (run_kmeans) through the code below. Dear readers, have you ever wished to make an app out of a very cool project you have been working on and share it with your friends after work? Or maybe thought about showing your results to your team with something more interesting and less casual than random graphs and images saved on your local machine, but maybe through a nice-looking interactive link? Well, it’s way easier than you can imagine now with the open- How to easily turn your Computer Vision project into an app by Marica Muffoletto import streamlit as st import altair as alt import pandas as pd import numpy as np import os import urllib import cv2 from sklearn.datasets import make_blobs from sklearn.cluster import KMeans import matplotlib.pyplot as plt import streamlit as st import random from PIL import Image def upload_image (selection): if selection == "Upload your own": filename = st.sidebar.file_uploader( "Choose File", type=["png", "jpg", "jpeg"])
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=