Skip to content

Commit

Permalink
Azure or AWS maybe i dont know
Browse files Browse the repository at this point in the history
  • Loading branch information
shauray8 committed Jun 11, 2021
1 parent 2dcd4ab commit d0db3e4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions calib/utils.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
from __future__ import division
import os, glob
import shutil
import matplotlib.pyplot as plt
import cv2
import os, glob

import torch
import shutil
import scipy.ndimage as ndimage
from torch.utils.data import DataLoader, Dataset
from PIL import Image
from imageio import imread

import random
import numpy as np
import numbers
import types
import scipy.ndimage as ndimage
from torch.utils.data import DataLoader, Dataset
import argparse

def openit(path, line):
Expand Down Expand Up @@ -141,6 +142,7 @@ def DATA_LOADER(root, split):
w = open(target_num[0],'r')
drive_img.append(w.read())
drive_img = drive_img[0].split("\n")

for i in range(len(input_img)-1):
yaw, pitch = drive_img[i].split(" ")
yaw = 0 if yaw == "nan" else yaw
Expand Down Expand Up @@ -207,6 +209,7 @@ def frame_by_frame(input):
frames.append(torch.zeros(frames[0].shape))
print("inner",len(frames))
final_images = [torch.cat((torch.tensor(frames[i]), torch.tensor(frames[i+1])), 1) for i in range(len(frames))]

print(len(final_image))
return final_image

Expand All @@ -215,11 +218,13 @@ def frame_by_frame(input):
def break_into_images():
input_vid = sorted(glob.glob(os.path.join('../labeled') + '/*.HEVC'))
folder = 0

for i in input_vid:
folder += 1
vidcap = cv2.VideoCapture(i)
success,image = vidcap.read()
count = 0

while success:
cv2.imwrite(f"../data/{folder}/frame%d.jpg" % count, image) # save frame as JPEG file
success,image = vidcap.read()
Expand All @@ -240,6 +245,7 @@ def onehot_vector(item, classes):
if item <= classes[i]:
onehot[i] = 1
break

return onehot

## ---------------- For Global Motion Aggregation ---------------- ##
Expand Down

0 comments on commit d0db3e4

Please sign in to comment.