Skip to content

Instantly share code, notes, and snippets.

View setval's full-sized avatar
🏠
Working from home

Nikita setval

🏠
Working from home
View GitHub Profile
@setval
setval / upload.sh
Created April 6, 2020 09:27
This script builds a Docker image, sets a tag, and loads a Docker container.
#!/bin/bash
set -e;
# the first argument is version for git and docker.
# the second argument is a name of the repository if you deploys in the other repositories.
# the third argument is a Dockerfile path.
# the fourth argument is a description for the git tag.
# if you don't add this argument, git opens the editor.
Rust 8 hrs 55 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 48.1%
C# 3 hrs 51 mins β–ˆβ–ˆβ–ˆβ–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 20.8%
TOML 1 hr 19 mins β–ˆβ–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 7.2%
Other 1 hr 2 mins β–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 5.6%
Lua 56 mins β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 5.1%
package chance
import "math/rand"
// Linear interpolation
func lerp(min, max, value float32) float32 {
return (1 - value) * min + value * max
}
type Item struct {
@setval
setval / detect-face.py
Created July 8, 2023 13:23
The script determines the position of the face and converts it into a square image centred on the face to create training in stable diffusion
import argparse
import os
import shutil
import cv2
parser = argparse.ArgumentParser()
parser.add_argument('--src', required=True)
parser.add_argument('--dst', required=True)