Skip to content

Instantly share code, notes, and snippets.

View CoffeeVampir3's full-sized avatar

Z CoffeeVampir3

View GitHub Profile
@CoffeeVampir3
CoffeeVampir3 / moondream_tag.py
Created February 13, 2024 20:44
moondream tagger
from transformers import AutoModelForCausalLM, CodeGenTokenizerFast as Tokenizer
from moondream import Moondream
from PIL import Image
from collections import Counter
import glob
import os
model = Moondream.from_pretrained("/home/blackroot/Desktop/moond/moondream1").to("cuda")
tokenizer = Tokenizer.from_pretrained("/home/blackroot/Desktop/moond/moondream1/tokenizer")
@CoffeeVampir3
CoffeeVampir3 / style.sh
Created February 13, 2024 20:11
Kohya SDXL style run
#!/bin/bash
# Config Start
# Configurations
ckpt="checkpoint path here" # base checkpoint to finetune
image_dir="training path here, should have images as subfolder" # folder containing folders with repeats_conceptname
reg_dir="" #optional, just point this to an empty folder if you don't care
output="output path here" # safetensors output folder
import sympy as sp
import random
from functools import partial
# Define the symbol
x = sp.symbols('x')
# Rules dictionary mapping rule names to (operation, inverse operation) tuples
rules = {
'addition': (lambda f, n: f + n, lambda f, n: f - n),
@CoffeeVampir3
CoffeeVampir3 / mov2seq.py
Created February 4, 2024 05:47
video stuff
from PIL import Image
import os
import numpy as np
import sys
import cv2
def video_to_frames(video_file, output_dir, one_every_n_frames):
# Create VideoCapture object
vidcap = cv2.VideoCapture(video_file)
fps = int(vidcap.get(cv2.CAP_PROP_FPS))
using UnrealBuildTool;
public class Necromonicon : ModuleRules
{
public Necromonicon(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
CppStandard = CppStandardVersion.Latest;
CStandard = CStandardVersion.Latest;
@CoffeeVampir3
CoffeeVampir3 / query thing.cpp
Created November 27, 2023 22:20
failed attempt at succeeding
NecroAiTask UNecroAiComponent::MoveToPoint(const FVector Dest, const float AcceptanceRadius = 160.0f) const
{
auto NavSys = Cast<UNavigationSystemV1>(GetWorld()->GetNavigationSystem());
check(NavSys);
auto NavProps = FNavAgentProperties(ControlledCharacter->GetSimpleCollisionRadius(), 128.f);
NavProps.bCanWalk = true;
NavProps.bCanFly = false;
auto Query = FPathFindingQuery();
Query.NavAgentProperties = NavProps;
@CoffeeVampir3
CoffeeVampir3 / example.cpp
Created November 27, 2023 03:01
State Machine Thing
#include <coroutine>
#include <iostream>
#include <utility>
#include <vector>
#include <list>
#include <deque>
#include <functional>
struct Task {
struct promise_type;
@CoffeeVampir3
CoffeeVampir3 / CoroThing.cpp
Created November 26, 2023 16:28
Coroutine Issue
#include <coroutine>
#include <iostream>
#include <utility>
#include <vector>
#include <list>
struct Task {
struct promise_type;
using TaskHandle = std::coroutine_handle<promise_type>;
struct promise_type {
@CoffeeVampir3
CoffeeVampir3 / CoroTask.h
Last active November 23, 2023 18:07
Spline Based Actor Pathfinding
#pragma once
#include <coroutine>
#include <utility>
struct CoroTask
{
struct promise_type;
using HandleType = std::coroutine_handle<promise_type>;
struct promise_type
{
@CoffeeVampir3
CoffeeVampir3 / gist:ff12d3e7e9b0378f8055d94359744c94
Created November 21, 2023 21:41
bad version of shitty script by jackasses
import math
import os
from glob import glob
from pathlib import Path
from typing import Optional
import cv2
import numpy as np
import torch
from einops import rearrange, repeat