This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from tqdm import tqdm | |
from pathlib import Path | |
import hashlib | |
import json | |
def download_file_with_progress(url, save_path): | |
""" | |
Downloads a file from a URL with a progress bar. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2009-2023 Blender Authors | |
# | |
# SPDX-License-Identifier: GPL-2.0-or-later | |
import bpy | |
from bpy.types import ( | |
Header, | |
Menu, | |
Panel, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bl_info = { | |
"name": "Robust Audio Sync", | |
"author": "tintwotin", | |
"version": (1, 8), | |
"blender": (2, 80, 0), | |
"location": "Sequencer > Strip > Transform > Robust Audio Sync", | |
"description": "Sync similar audio recordings", | |
"warning": "", | |
"doc_url": "", | |
"category": "Sequencer", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
class RETIMING_PT_panel(bpy.types.Panel): | |
bl_label = "Retiming" | |
bl_idname = "RETIMING_PT_panel" | |
bl_space_type = 'SEQUENCE_EDITOR' | |
bl_region_type = 'UI' | |
bl_category = 'Strip' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def forward(self, x, timesteps=None, context=None, y=None, **kwargs): | |
# broadcast timesteps to batch dimension | |
timesteps = timesteps.expand(x.shape[0]) | |
hs = [] | |
t_emb = get_timestep_embedding(timesteps, self.model_channels) # , repeat_only=False) | |
t_emb = t_emb.to(x.dtype) | |
emb = self.time_embed(t_emb) | |
assert x.shape[0] == y.shape[0], f"batch size mismatch: {x.shape[0]} != {y.shape[0]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addon_prefs = bpy.context.preferences.addons[__package__].preferences |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def find_image_in_video(video_path, image_path): | |
# Load the video clip | |
cap = cv2.VideoCapture(video_path) | |
# Load the image template | |
template = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def detect_clapperboard(frame, clapperboard_template): | |
# Convert the frame to grayscale | |
gray_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
# Use template matching to find the clapperboard | |
result = cv2.matchTemplate(gray_frame, clapperboard_template, cv2.TM_CCOEFF_NORMED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
import os | |
import bpy | |
import pkgutil | |
# Get the path to the Python interpreter used by Blender | |
python_path = sys.executable | |
# Determine the script directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
def join(vse, current_strip, next_strip): | |
# Calculate the duration of the next strip | |
duration = next_strip.frame_final_end - next_strip.frame_final_start | |
# Remove the next strip from the VSE | |
vse.sequences.remove(next_strip) |
NewerOlder