karolmajek commited on
Commit
67b6de8
1 Parent(s): a1bee39

cv2 headless :bomb:

Browse files
Files changed (2) hide show
  1. app.py +0 -2
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,5 +1,4 @@
1
  from PIL import Image
2
- import cv2
3
  import torch
4
  from numpy import random
5
 
@@ -63,7 +62,6 @@ def detect(pil_img,names):
63
  for *xyxy, conf, cls in det:
64
  label = '%s %.2f' % (names[int(cls)], conf)
65
  plot_one_box(xyxy, img_np, label=label, color=colors[int(cls)], line_thickness=3)
66
- cv2.imwrite('/tmp/aaa.jpg',img_np[:,:,::-1])
67
  return Image.fromarray(img_np)
68
 
69
 
1
  from PIL import Image
 
2
  import torch
3
  from numpy import random
4
 
62
  for *xyxy, conf, cls in det:
63
  label = '%s %.2f' % (names[int(cls)], conf)
64
  plot_one_box(xyxy, img_np, label=label, color=colors[int(cls)], line_thickness=3)
 
65
  return Image.fromarray(img_np)
66
 
67
 
requirements.txt CHANGED
@@ -4,7 +4,8 @@
4
  Cython
5
  matplotlib>=3.2.2
6
  numpy>=1.18.5
7
- opencv-python>=4.1.2
 
8
  Pillow
9
  PyYAML>=5.3.1
10
  scipy>=1.4.1
4
  Cython
5
  matplotlib>=3.2.2
6
  numpy>=1.18.5
7
+ # opencv-python>=4.1.2
8
+ opencv-python-headless>=4.1.2
9
  Pillow
10
  PyYAML>=5.3.1
11
  scipy>=1.4.1