Closed Ectsang closed 7 years ago
Hi,
The notebooks are not very consistent with the rest of the code, as I refactored the rest, but the function it tries to call is this one:
import json
import sys
from progressbar import ProgressBar
import cv2
from work.config.config import STORED_VIDEOS_PATH
def get_number_of_frames(video_path):
""" Returns the number of frames of the video stored at the path given
"""
cap = cv2.VideoCapture(video_path)
if not cap.isOpened():
print("Could not open: " + video_path)
return None
return int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT))
Also it won't be necessary to call it, as the dataset file provided by the repo at videos.json contains the number of frames of each video.
I hope I had helped.
What if I ran download_videos.sh and only downloaded 4726 videos out of the total 19994? Can I still use the repo's videos.json?
It's quite odd that only downloads 1/4 of the videos. Anyway, your already download videos will be on videos.json
, so you can duplicate this file and keep only the videos you already downloaded.
According to the notebook "01 Checking Downloaded Videos" we're suppose to run:
python get_nb_frames.py ../../dataset/tmp/dataset_downloaded.json ../../dataset/tmp/dataset_downloaded_nb_frames.json
Where is get_nb_frames.py? Can't seem to locate it.