streamlit / demo-self-driving Goto Github PK
View Code? Open in Web Editor NEWStreamlit app demonstrating an image browser for the Udacity self-driving-car dataset with realtime object detection using YOLO.
License: Apache License 2.0
Streamlit app demonstrating an image browser for the Udacity self-driving-car dataset with realtime object detection using YOLO.
License: Apache License 2.0
I'm trying to pip install streamlit
on my local Mac in a new conda virtual environment. I'm getting this error:
Building wheels for collected packages: watchdog
Building wheel for watchdog (setup.py) ... error
ERROR: Command errored out with exit status 1:
And 2 more pages on red error logs, which I can provide if need be.
Any advice will be highly appreciated.
"The ignore_hash
argument has been renamed to allow_output_mutation
."
I was experimenting this project for the first time and got this error:
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://192.168.2.201:8501
2022-06-11 02:58:54.238 Uncaught app exception
Traceback (most recent call last):
File "C:\Python39\lib\urllib\request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "C:\Python39\lib\http\client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Python39\lib\http\client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Python39\lib\http\client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Python39\lib\http\client.py", line 1040, in _send_output
self.send(msg)
File "C:\Python39\lib\http\client.py", line 980, in send
self.connect()
File "C:\Python39\lib\http\client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "C:\Python39\lib\ssl.py", line 501, in wrap_socket
return self.sslsocket_class._create(
File "C:\Python39\lib\ssl.py", line 1041, in _create
self.do_handshake()
File "C:\Python39\lib\ssl.py", line 1310, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python39\lib\site-packages\streamlit\scriptrunner\script_runner.py", line 554, in _run_script
exec(code, module.__dict__)
File "C:\Users\Helio\AppData\Local\Temp\tmps_c7nr8c\streamlit_app.py", line 294, in <module>
main()
File "C:\Users\Helio\AppData\Local\Temp\tmps_c7nr8c\streamlit_app.py", line 32, in main
download_file(filename)
File "C:\Users\Helio\AppData\Local\Temp\tmps_c7nr8c\streamlit_app.py", line 62, in download_file
with urllib.request.urlopen(EXTERNAL_DEPENDENCIES[file_path]["url"]) as response:
File "C:\Python39\lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "C:\Python39\lib\urllib\request.py", line 517, in open
response = self._open(req, data)
File "C:\Python39\lib\urllib\request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "C:\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Python39\lib\urllib\request.py", line 1389, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "C:\Python39\lib\urllib\request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)>
Windows 10 64bit, Python 3.9.13
The Side Bar to Run the project was not rendered.
I tried to use this app in a docker container and when I select the "run the app" app mode it doesn't work.
I get:
UnhashableType: Cannot hash object of type numpy.ufunc
While caching some code, Streamlit encountered an object of type numpy.ufunc. You’ll need to help Streamlit understand how to hash that type with the hash_funcs argument. For example:
@st.cache(hash_funcs={numpy.ufunc: my_hash_func})
def my_func(...):
...
Please see the hash_funcs documentation for more details.
Traceback:
File "/tmp/tmprl6zpn8j/app.py", line 296, in <module>
main()
File "/tmp/tmprl6zpn8j/app.py", line 45, in main
run_the_app()
File "/tmp/tmprl6zpn8j/app.py", line 116, in run_the_app
selected_frame_index, selected_frame = frame_selector_ui(summary)
File "/tmp/tmprl6zpn8j/app.py", line 147, in frame_selector_ui
selected_frames = get_selected_frames(summary, object_type, min_elts, max_elts)
I am using docker container python:latest
and running:
pip install --upgrade streamlit opencv-python
as specified in the readme.
Python is: Python 3.8.1
pip is installing numpy: numpy-1.18.1
any ideas?
'gbk' codec can't decode byte 0x94 in position 9229: illegal multibyte sequence
Hi. I am trying to run the app in https://github.com/streamlit/demo-self-driving, an example for streamlit application in object detection.
However, when running the app, I got an AttributeError. I have not downloaded the repo. Although, I am lauching the app directly from the github repo.
I have followed the instructions in the the README demo:
It is expected that the app will run and display the images with the object detection. Instead, I am getting this error.
When I select the "Run the app" option in the left sidebar, I get the following error:
I'll be thankful if anyone can help.
It would be great to have a pipenv file for this repo so that I can easily get the same dependencies as you did.
This app doesn't work on streamlit sharing
I am working on an object detection app with streamlit it works perfectly on my system but when i try to deploy it on Streamlit Sharing I get this error:
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Traceback:
File "/usr/local/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script
exec(code, module.__dict__)
File "/app/demo-self-driving/streamlit_app.py", line 23, in <module>
import os, urllib, cv2
File "/home/appuser/.local/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>
from .cv2 import *
x-special/nautilus-clipboard
I noticed the error had to do with opencv, so i decided to try the demo-self-driving app of streamlit to see how they handled this error, it turns out this app has the very same error, the app{demo-self-driving} works perfectly when i run:
streamlit run https://raw.githubusercontent.com/streamlit/demo-self-driving/master/streamlit_app.py
import pandas as pd
import streamlit as st
from sklearn import datasets
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.datasets import make_moons
import numpy as np
import math
from sklearn.svm import SVC
df = pd.read_csv("./winequality-white.csv", sep=';')
print(df.head(5))
print()
X = df.drop('quality', axis=1)
y = df['quality']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=8)
model_list = ['Decision Tree (DT)', 'Support Vector Machine (SVM)', 'RandomForest(RF)']
classifiers = st.selectbox("Which machine learning classifier model is used?", model_list)
if classifiers == 'Decision Tree (DT)':
# train the decision tree
dt = DecisionTreeClassifier()
# we train the model with fit() function
dt.fit(X_train, y_train)
# after training the model, we can evaluate the model performance with test dataset
# we can calculate the prediction accuracy
accuracy = dt.score(X_test, y_test)
# we can also show the evaluation results on the APP
st.write("Classification accuracy: ", accuracy)
# we can make prediction with trained model
pred_dt = dt.predict(X_test)
# then, we can calculate the confusion matrix with predicted values and real values
con_matrix_dt = accuracy_score(y_test, pred_dt)
# lastly, we can show the confusion matrix results on the APP
st.write("Confusion Matrix: ", con_matrix_dt)
print("The decision tree model is trained successfully!")
print()
elif classifiers == 'Support Vector Machine (SVM)':
# train the SVM
svc = SVC()
# we train the model with fit() function
svc.fit(X_train, y_train)
# after training the model, we can evaluate the model performance with test dataset
# we can calculate the prediction accuracy
accuracy = svc.score(X_test, y_test)
# we can also show the evaluation results on the APP
st.write("Classification accuracy: ", accuracy)
# we can make prediction with trained model
pred_svc = svc.predict(X_test)
# then, we can calculate the confusion matrix with predicted values and real values
con_matrix_svc = accuracy_score(y_test, pred_svc)
# lastly, we can show the confusion matrix results on the APP
st.write("Confusion Matrix: ", con_matrix_svc)
print("SVC is trained successfully!")
print()
else:
# train an ensemble bagging learner (RandomForest)
rf_model = RandomForestClassifier()
# we train the model with fit() function
rf_model.fit(X_train, y_train)
# after training the model, we can evaluate the model performance with test dataset
# we can calculate the prediction accuracy
accuracy = rf_model.score(X_test, y_test)
# we can also show the evaluation results on the APP
st.write("Classification accuracy: ", accuracy)
pred_rf_model = rf_model.predict(X_test)
con_matrix_rf = accuracy_score(y_test, pred_rf_model)
st.write("Confusion Matrix: ", con_matrix_rf)
print("The ensemble bagging learner - RandomForrest is trained successfully!")
print()
st.title("White wine machine learning prediction!")
st.sidebar.header("User Input Parameters.")
def user_input_features():
fixed_acidity = st.sidebar.slider("Fixed Acidity", 6.0, 9.0, 7.0)
volatile_acidity = st.sidebar.slider("Volatile Acidity", 0.2, 0.4, 0.27)
citric_acid = st.sidebar.slider("Citric Acid", 0.3, 0.5, 0.36)
residual_sugar = st.sidebar.slider("Residual Sugar", 0.1, 25.0, 20.7)
chlorides = st.sidebar.slider("Chlorides", 0.04, 0.06)
free_sulfur_dioxide = st.sidebar.slider("Free Sulfur Dioxide", 17, 200, 170)
total_sulfur_dioxide = st.sidebar.slider("Total Sulfur Dioxide", 0.1, 3.0, 1.001)
density = st.sidebar.slider("Density", 0.8, 2.0, 1.001)
pH = st.sidebar.slider("pH", 1.0, 7.0, 3.0)
sulphates = st.sidebar.slider("Sulphates", 0.3, 0.5, 0.45)
alcohol = st.sidebar.slider("Alcohol", 1, 10, 6)
# create a data dictionary
data = {
"fixed_acidity": float(fixed_acidity),
"volatile_acidity": float(volatile_acidity),
"citric_acid": float(citric_acid),
"residual_sugar": float(residual_sugar),
"chlorides": float(chlorides),
"free_sulfur_dioxide": float(free_sulfur_dioxide),
"total_sulfur_dioxide": float(total_sulfur_dioxide),
"density": float(density),
"pH": float(pH),
"sulphates": float(sulphates),
"alcohol": float(alcohol)
}
# create a dataframe with data stored in the dictionary
features_df = pd.DataFrame(data=data, index=[0])
return features_df
user_inputs = user_input_features()
st.subheader("Users' Inputs")
st.write(user_inputs)
Running streamlit run https://raw.githubusercontent.com/streamlit/demo-self-driving/master/app.py
gives me this error:
E:\WPy-3710\python-3.7.1.amd64>streamlit run https://raw.githubusercontent.com/streamlit/demo-self-driving/master/app.py
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\streamlit.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "c:\python27\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\python27\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\python27\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\python27\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\python27\lib\site-packages\streamlit\cli.py", line 149, in main_run
_main_run(fp.name, args)
File "c:\python27\lib\site-packages\streamlit\cli.py", line 179, in _main_run
bootstrap.run(file, command_line, args)
File "c:\python27\lib\site-packages\streamlit\bootstrap.py", line 181, in run
server.add_preheated_report_session()
File "c:\python27\lib\site-packages\streamlit\server\Server.py", line 393, in add_preheated_report_session
session = self._add_browser_connection(PREHEATED_REPORT_SESSION)
File "c:\python27\lib\site-packages\streamlit\server\Server.py", line 422, in _add_browser_connection
command_line=self._command_line,
File "c:\python27\lib\site-packages\streamlit\ReportSession.py", line 96, in __init__
self._report, self._on_source_file_changed
File "c:\python27\lib\site-packages\streamlit\watcher\LocalSourcesWatcher.py", line 87, in __init__
module_name=None, # Only the root script has None here.
File "c:\python27\lib\site-packages\streamlit\watcher\LocalSourcesWatcher.py", line 110, in _register_watcher
watcher=FileWatcher(filepath, self.on_file_changed), module_name=module_name
File "c:\python27\lib\site-packages\streamlit\watcher\EventBasedFileWatcher.py", line 86, in __init__
file_watcher.watch_file(file_path, on_file_changed)
File "c:\python27\lib\site-packages\streamlit\watcher\EventBasedFileWatcher.py", line 160, in watch_file
folder_handler.add_file_change_listener(file_path, callback)
File "c:\python27\lib\site-packages\streamlit\watcher\EventBasedFileWatcher.py", line 248, in add_file_change_listener
md5 = util.calc_md5_with_blocking_retries(file_path)
File "c:\python27\lib\site-packages\streamlit\watcher\util.py", line 68, in calc_md5_with_blocking_retries
raise e
IOError: [Errno 13] Permission denied: 'c:\\users\\user\\appdata\\local\\temp\\tmpi3xndk'
Debug info
Streamlit version: 0.47.2
Python version: 3.7.1
Using Conda? PipEnv? PyEnv? Pex? pip on WinPython
OS version: Windows 10 version 1903
Browser version: Firefox 69.0
Traceback (most recent call last):
File "/Users/andreosee/anaconda3/bin/streamlit", line 6, in
from streamlit.cli import main
File "/Users/andreosee/anaconda3/lib/python3.7/site-packages/streamlit/init.py", line 99, in
from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator
File "/Users/andreosee/anaconda3/lib/python3.7/site-packages/streamlit/delta_generator.py", line 25, in
from streamlit.proto import BlockPath_pb2
File "/Users/andreosee/anaconda3/lib/python3.7/site-packages/streamlit/proto/BlockPath_pb2.py", line 21, in
create_key=_descriptor._internal_create_key,
AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'
(base) ➜ ~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.