Skip to content

Instantly share code, notes, and snippets.

View eek's full-sized avatar
🎯
̿̿ ̿̿ ̿̿ ̿'̿'\̵͇̿̿\З= ( ▀ ͜͞ʖ▀) =Ε/̵͇̿̿/’̿’̿ ̿ ̿̿ ̿̿ ̿̿

Radu-Sebastian Amarie eek

🎯
̿̿ ̿̿ ̿̿ ̿'̿'\̵͇̿̿\З= ( ▀ ͜͞ʖ▀) =Ε/̵͇̿̿/’̿’̿ ̿ ̿̿ ̿̿ ̿̿
View GitHub Profile
@eek
eek / kimi-vl-a3b-instruct-video-inference-script-cli.py
Created April 10, 2025 09:19
This script extracts frames from videos and generates descriptions using the Kimi-VL-A3B model. It takes the following arguments: video_path (required): Path to the input video file --max_frames (default=1): Maximum number of frames to extract --save_dir (default="./test-frames"): Directory to save extracted frames --prompt (default="Describe th…
import cv2
import argparse
import torch
import os # Added import
from PIL import Image
from transformers import AutoModelForCausalLM, AutoProcessor
# Function to extract frames from video, save them, and return paths
def extract_frames(video_path, save_dir, target_fps=1, max_frames=1):
"""Extracts up to max_frames from a video file at target FPS, saves them, and returns their paths."""
@eek
eek / slugify.js
Last active August 4, 2021 14:23
Vanilla JavaScript Slugify + Accent removal - Just another JavaScript Slugifier with an extra line for Accent Removal
function slugify(text) {
return text.toString().toLowerCase().trim()
.normalize('NFD') // separate accent from letter
.replace(/[\u0300-\u036f]/g, '') // remove all separated accents
.replace(/\s+/g, '-') // replace spaces with -
.replace(/&/g, '-and-') // replace & with 'and'
.replace(/[^\w\-]+/g, '') // remove all non-word chars
.replace(/--+/g, '-') // replace multiple '-' with single '-'
}
@eek
eek / localStoragePollyfill.js
Last active August 9, 2017 10:59
localStorage Pollyfill for Safari / Chrome Private / Incognito Mode & Others
try {
localStorage.setItem('test', true);
} catch (e) {
if (e.code == 22) { //localStorage exists but size limit -> Probably Safari Private Mode.
localStorage.__proto__ = Object.create(Storage.prototype);
localStorage.__proto__._data = {};
localStorage.__proto__.setItem = function (id, val) {
return this._data[id] = String(val)
};
localStorage.__proto__.getItem = function (id) {