Ubuntu commited on
Commit
2f4dab4
·
1 Parent(s): 3991567
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +5 -1
  2. app.py +5 -1
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -11,6 +11,9 @@ import pytorch_lightning as pl
11
  from torch.utils.data import DataLoader
12
  from torchmetrics import Accuracy
13
  from torchvision import transforms
 
 
 
14
  HF_DATASETS_CACHE="./"
15
 
16
 
@@ -118,7 +121,8 @@ def video_identity(video,user_name,class_name,trainortest,ready):
118
  success, frame = capture.read()
119
 
120
  if success:
121
- cv2.imwrite(f'{class_d}/frame_{frameNr}.jpg', frame)
 
122
 
123
  else:
124
  break
 
11
  from torch.utils.data import DataLoader
12
  from torchmetrics import Accuracy
13
  from torchvision import transforms
14
+ from PIL import Image
15
+ import PIL
16
+
17
  HF_DATASETS_CACHE="./"
18
 
19
 
 
121
  success, frame = capture.read()
122
 
123
  if success:
124
+ # cv2.imwrite(f'{class_d}/frame_{frameNr}.jpg', frame)
125
+ frame=frame.save(f'{class_d}/frame_{frameNr}.jpg')
126
 
127
  else:
128
  break
app.py CHANGED
@@ -11,6 +11,9 @@ import pytorch_lightning as pl
11
  from torch.utils.data import DataLoader
12
  from torchmetrics import Accuracy
13
  from torchvision import transforms
 
 
 
14
  HF_DATASETS_CACHE="./"
15
 
16
 
@@ -118,7 +121,8 @@ def video_identity(video,user_name,class_name,trainortest,ready):
118
  success, frame = capture.read()
119
 
120
  if success:
121
- cv2.imwrite(f'{class_d}/frame_{frameNr}.jpg', frame)
 
122
 
123
  else:
124
  break
 
11
  from torch.utils.data import DataLoader
12
  from torchmetrics import Accuracy
13
  from torchvision import transforms
14
+ from PIL import Image
15
+ import PIL
16
+
17
  HF_DATASETS_CACHE="./"
18
 
19
 
 
121
  success, frame = capture.read()
122
 
123
  if success:
124
+ # cv2.imwrite(f'{class_d}/frame_{frameNr}.jpg', frame)
125
+ frame=frame.save(f'{class_d}/frame_{frameNr}.jpg')
126
 
127
  else:
128
  break