muskan19 commited on
Commit
9f9536d
·
verified ·
1 Parent(s): 60975a5

Upload preprocess.py

Browse files
Files changed (1) hide show
  1. src/preprocess.py +13 -0
src/preprocess.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # preprocess.py placeholder
2
+ import cv2
3
+ import numpy as np
4
+
5
+ IMG_SIZE = (224, 224)
6
+
7
+ def preprocess_frame(frame):
8
+ frame = cv2.resize(frame, IMG_SIZE)
9
+ frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
10
+ frame = np.expand_dims(frame, axis=0)
11
+ frame = frame / 255.0
12
+ return frame
13
+