Skip to content

Instantly share code, notes, and snippets.

View popescuaaa's full-sized avatar
:octocat:
Shaping the future...

Popescu Andrei popescuaaa

:octocat:
Shaping the future...
View GitHub Profile
## 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
@HaydenFaulkner
HaydenFaulkner / extract_frames.py
Last active December 24, 2021 17:49
Extract frames from a video using Python and OpenCV
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?
@Pen-y-Fan
Pen-y-Fan / Test Driven Development (TDD) Learning Plan.md
Last active March 31, 2025 11:17
Test Driven Development (TDD)

Learning Plan for Test Driven Development (TDD)

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)