Commit f76ac722 authored by Gihan Jayatilaka's avatar Gihan Jayatilaka

a

parent f4d3196a
......@@ -46,14 +46,14 @@ def makeVideo(READ_VIDEO_FILE,msg,WRITE_VIDEO_FILE,DELTA):
mask = np.repeat(mask, HEIGHT/GRID_Y, axis=0)
mask = np.repeat(mask, WIDTH/GRID_X, axis=1)
mask = (mask==np.full(shape=mask.shape,fill_value=0)).astype(np.float32)*np.random.uniform(low=0.0,high=0.2,size=mask.shape) \
'''mask = (mask==np.full(shape=mask.shape,fill_value=0)).astype(np.float32)*np.random.uniform(low=0.0,high=0.2,size=mask.shape) \
+ (mask==np.full(shape=mask.shape,fill_value=1)).astype(np.float32)*np.random.uniform(low=0.8,high=1.0,size=mask.shape)
if flip(0.6):
if flip(0.6):
mask=cv2.GaussianBlur(mask,ksize=(5,5),sigmaX=0)
else:
mask=cv2.GaussianBlur(mask,ksize=(15,15),sigmaX=0)
mask=cv2.GaussianBlur(mask,ksize=(15,15),sigmaX=0)'''
raw = cv2.cvtColor(cv2.resize(frame, (WIDTH, HEIGHT)), cv2.COLOR_BGR2LAB)
......@@ -96,8 +96,8 @@ def makeVideo(READ_VIDEO_FILE,msg,WRITE_VIDEO_FILE,DELTA):
if __name__ == "__main__":
np.random.seed(0)
print("python gen-rand-train-data.py video.mp4 10000 10 10 1.0 10.0 vidOut.mp4")
print("python gen-rand-train-data.py [1] [2] [3] [4] [5] [6] [7]")
print("python gen-rand-train-data.py video.mp4 10000 10 10 1.0 10.0 vidOut.mp4 saveY.npz")
print("python gen-rand-train-data.py [1] [2] [3] [4] [5] [6] [7] [8]")
VIDEO_IN_FILE=sys.argv[1]
NO_FRAMES=int(sys.argv[2])
......@@ -106,8 +106,12 @@ if __name__ == "__main__":
DELTA_MIN=float(sys.argv[5])
DELTA_MAX=float(sys.argv[6])
VIDEO_OUT_FILE=sys.argv[7]
LABELS_SAVE_FILE=sys.argv[8]
randMsg=np.random.randint(low=0,high=2,size=(NO_FRAMES,GRID_HEIGHT,GRID_WIDTH),dtype=np.int32)
np.savez(LABELS_SAVE_FILE,Y=randMsg)
print("Saved NPZ")
deltas=np.random.uniform(low=DELTA_MIN,high=DELTA_MAX,size=(NO_FRAMES))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment