Skip to content

Instantly share code, notes, and snippets.

View dchae's full-sized avatar
:shipit:

Daniel Chae dchae

:shipit:
View GitHub Profile
#!/usr/bin/env python3
"""
Script to extract InternVL embeddings from MP4 video files.
Usage: python extract_video_embeddings.py <path_to_video.mp4>
"""
import argparse
import sys
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
@dchae
dchae / README.md
Created May 14, 2025 22:36 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

path = r"input.txt"
with open(path, "r") as f:
lines = f.readlines()
stripped_lines = [line.strip() for line in lines]
reports = [[int(x) for x in line.split()] for line in stripped_lines]
def is_safe(report):
deltas = []
for i in range(0, len(report) - 1):
path = r"input.txt"
with open(path, "r") as f:
reports = [[int(x) for x in line.strip().split()] for line in f.readlines()]
def is_safe(report):
deltas = [report[i + 1] - report[i] for i in range(len(report) - 1)]
return (
len(set(max(-1, min(1, x)) for x in deltas)) == 1
and max(abs(x) for x in deltas) < 4