Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Dash app not running

I am trying to run my app using Dash but it’s not displaying , it says it’s running but when I open the @ page it does’t show
this is my code :
import dash
import dash_html_components as html

import base64
import face_recognition

app = dash.Dash(name)

image = face_recognition.load_image_file(“image.jpg”)
face_locations = face_recognition.face_locations(image)

encoded_image = base64.b64encode(open(‘image.jpg’, ‘rb’).read())

app.layout = html.Div([
html.H1(“Facial Recognition”),
html.P(“I found {} face(s) in this photograph.”.format(len(face_locations))),
html.Img(src=‘data:image/png;base64,{}’.format(encoded_image.decode()))
])

if name == ‘main’:
app.run_server(debug=True)

I don’t have face_recognition installed so I commented those portions out. With the latest version of Dash, your page loads otherwise. if you have any errors during page load, then this would explain why your web page doesn’t populate.

import dash
import dash_html_components as html
import base64

# import face_recognition

app = dash.Dash()

# image = face_recognition.load_image_file('image.jpg')
# face_locations = face_recognition.face_locations(image)

# encoded_image = base64.b64encode(open('image.jpg', 'rb').read())
face_locations = []

app.layout = html.Div(
    [
        html.H1('Facial Recognition'),
        html.P('I found {} face(s) in this photograph.'.format(len(face_locations))),
        # html.Img(src='data: image / png; base64, {}'.format(encoded_image.decode()))
    ]
)

if __name__ == '__main__':
    app.run_server(debug=True)