sandygmaharaj commited on
Commit
c5e1ffe
·
1 Parent(s): 6398fcc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,7 @@ from PIL import Image, ImageDraw
9
  device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
10
  print('Running on device: {}'.format(device))
11
 
12
- mtcnn = MTCNN(margin=20, keep_all=True, post_process=False, device=device)
13
 
14
  learn = load_learner('export.pkl')
15
 
@@ -26,7 +26,7 @@ def predict(img):
26
  coords = tuple(box.tolist())
27
  pred,pred_idx,probs = learn.predict(img.crop(coords))
28
  draw.rectangle(coords, outline=(0, 0, 0), width=1)
29
- button_draw.text((coords[0]-10, coords[1]-10), pred, font=ImageFont.truetype("arial"))
30
  return o_img
31
  '''
32
  emotions["x"].append((coords[0] + coords[2])/2)
 
9
  device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
10
  print('Running on device: {}'.format(device))
11
 
12
+ mtcnn = MTCNN(margin=40, keep_all=True, post_process=False, device=device)
13
 
14
  learn = load_learner('export.pkl')
15
 
 
26
  coords = tuple(box.tolist())
27
  pred,pred_idx,probs = learn.predict(img.crop(coords))
28
  draw.rectangle(coords, outline=(0, 0, 0), width=1)
29
+ draw.text((coords[0]-10, coords[1]-10), pred, font=ImageFont.truetype("arial"))
30
  return o_img
31
  '''
32
  emotions["x"].append((coords[0] + coords[2])/2)