Spaces:
Build error
Build error
Rename app-1.py to app.py
Browse files- app-1.py → app.py +2 -2
app-1.py → app.py
RENAMED
|
@@ -368,7 +368,7 @@ def extract_visual_features(image):
|
|
| 368 |
histogram_length = sum(histogram)
|
| 369 |
samples_probability = [float(h) / histogram_length for h in histogram if h != 0]
|
| 370 |
entropy = -sum([p * math.log(p, 2) for p in samples_probability])
|
| 371 |
-
entropy = round(entropy / 8
|
| 372 |
|
| 373 |
# Return the computed features
|
| 374 |
return {
|
|
@@ -872,7 +872,7 @@ with gr.Blocks() as demo:
|
|
| 872 |
emo_happy_output = gr.Textbox(label='Happy')
|
| 873 |
emo_sad_output = gr.Textbox(label='Sad')
|
| 874 |
emo_surprise_output = gr.Textbox(label='Surprise')
|
| 875 |
-
emo_neutral_output = gr.Textbox(label='
|
| 876 |
|
| 877 |
|
| 878 |
# Define the function to be called when the button is clicked
|
|
|
|
| 368 |
histogram_length = sum(histogram)
|
| 369 |
samples_probability = [float(h) / histogram_length for h in histogram if h != 0]
|
| 370 |
entropy = -sum([p * math.log(p, 2) for p in samples_probability])
|
| 371 |
+
entropy = round(entropy / 8, 4)
|
| 372 |
|
| 373 |
# Return the computed features
|
| 374 |
return {
|
|
|
|
| 872 |
emo_happy_output = gr.Textbox(label='Happy')
|
| 873 |
emo_sad_output = gr.Textbox(label='Sad')
|
| 874 |
emo_surprise_output = gr.Textbox(label='Surprise')
|
| 875 |
+
emo_neutral_output = gr.Textbox(label='Neutral')
|
| 876 |
|
| 877 |
|
| 878 |
# Define the function to be called when the button is clicked
|