Quantcast
Channel: Data Science, Analytics and Big Data discussions - Topics tagged data_science
Viewing all articles
Browse latest Browse all 787

Step-by-Step Deep Learning Tutorial to Build your own Video Classification Model

$
0
0

Hello sir I am new in the field of machine learning. For a few days I am trying to run a code which is related to video classification. But I was unable to run that code because i think that my code is unable to fetch the directory of the dataset. whent i run this code given below

storing the frames from training videos

for i in tqdm(range(train.shape[0])):
count = 0
videoFile = train[‘video_name’][i]
#print(videoFile)
cap = cv2.VideoCapture(’/content/drive/My Drive/Colab Notebooks/Dataset-UCF101/UCF-101/’+videoFile.split(’ ‘)[0].split(’/’)[1]) # capturing the video from the given path
frameRate = cap.get(5) #frame rate
x=1
while(cap.isOpened()):
frameId = cap.get(1) #current frame number
ret, frame = cap.read()
if (ret != True):
break
if (frameId % math.floor(frameRate) == 0):
# storing the frames in a new folder named train_1
filename =’/content/drive/My Drive/Colab Notebooks/Dataset-UCF101/UCF-101/train_1/’ + videoFile.split(’/’)[1].split(’ ')[0] +"_frame%d.jpg" % count;count+=1
cv2.imwrite(filename, frame)
cap.release()

I found nothing in the train_1 directory. So, it would be kind enough if any one help me to solve the problem. Note: I use a shared dataset and I have the access over that. I can run and view any .csv or .txt file from that dataset but incase of video I get nothing. Thank You.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 787

Trending Articles