njgroene commited on
Commit
9521e56
1 Parent(s): c3057ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -1,6 +1,18 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  # pipeline = pipeline(task="image-classification", model="njgroene/fairface")
5
 
6
  def predict(image):
@@ -9,7 +21,7 @@ def predict(image):
9
 
10
  gr.Interface(
11
  predict,
12
- inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"),
13
  outputs=gr.outputs.Label(num_top_classes=2),
14
- title="Hot Dog? Or Not?",
15
  ).launch()
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ from PIL import Image
5
+ import pandas as pd
6
+ import numpy as np
7
+
8
+ import torch
9
+ import torch.nn as nn
10
+ import torchvision
11
+ from torchvision import datasets, models, transforms
12
+
13
+ from torch_mtcnn import detect_faces
14
+ from torch_mtcnn import show_bboxes
15
+
16
  # pipeline = pipeline(task="image-classification", model="njgroene/fairface")
17
 
18
  def predict(image):
 
21
 
22
  gr.Interface(
23
  predict,
24
+ inputs=gr.inputs.Image(label="Upload a profile picture of a single person", type="filepath"),
25
  outputs=gr.outputs.Label(num_top_classes=2),
26
+ title="Estimate age and gender from profile picture",
27
  ).launch()