These learning resources primarily focus on Test Driven Development (TDD).
- There is an emphasis on learning using PHP, Laravel and PHPUnit.
- All these resources are free (at the time of writing)
| ## Imports | |
| from typing import Tuple | |
| import torch | |
| from torch import Module, Tensor | |
| from transformers.models.roberta.modeling_roberta import RobertaPreTrainedModel, RobertaConfig, RobertaModel, RobertaEncoder | |
| from torch.nn import CrossEntropyLoss, CosineEmbeddingLoss | |
| ## Function |
| import cv2 | |
| import os | |
| def extract_frames(video_path, frames_dir, overwrite=False, start=-1, end=-1, every=1): | |
| """ | |
| Extract frames from a video using OpenCVs VideoCapture | |
| :param video_path: path of the video | |
| :param frames_dir: the directory to save the frames | |
| :param overwrite: to overwrite frames that already exist? |