Skip to content

Instantly share code, notes, and snippets.

View veonua's full-sized avatar

Andrew Me veonua

  • Oslo
View GitHub Profile
@veonua
veonua / Docker
Last active April 13, 2023 14:20
Fastchat vicuna-13b
FROM depositame/xform_8bit_pytorch
RUN apt-get -y install git-lfs
RUN mkdir /model
WORKDIR /model/
RUN git lfs clone https://huggingface.co/eachadea/vicuna-13b .
RUN rm -rf ./git
RUN pip3 install fschat
RUN pip3 install git+https://github.com/huggingface/transformers
005d550f2a13313c0000011700161830
0055550f2a13313c0000011700161830
closed
---
0055550f2a13313c0000011700161838
005d550f2a13313c0000011700161838
opened
005d550f2a13313c0000011700161830
import numpy as np
def vectorize(val:float):
INT = 5
FRACT = 2
r = np.zeros((INT+FRACT, 10))
ff = f'%{FRACT+INT+1}.{FRACT}f'
s = ff%val
i = -1
for c in s:
def resize_f(img, bo, _begin, _end):
k = 8
return tf.image.resize_with_pad(img, int(4032/k), int(3024 /k), method=tf.image.ResizeMethod.AREA) #, bo, _begin, _end
def random_rotate(image):
r = tf.random.uniform([3])*.3 # numpy.random.rand((3)) * 0.3
transform = tf.compat.v1.py_func( rotate3d_transform, [image, r[0],r[1],r[2]], tf.float32 )
return tfa.image.transform(image, transforms=tf.reshape(transform,[-1])[:8], interpolation='BILINEAR')
import collections
IslandInfo = collections.namedtuple('IslandInfo', 'area height_sum')
c_clabel = -1
colors = np.zeros_like(padded).astype(int)
heights = list()
area = list()
associations = list()
@veonua
veonua / fixLayout.kt
Last active June 26, 2018 18:45
fix keyboard layout English to Russian and vice versa. Исправление раскладки клавиатуры для поисковых запросов Английский в Русский и наоборот
import com.uchuhimo.collections.BiMap
import com.uchuhimo.collections.toBiMap
val eng = "~!@#$%^&*()QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?`qwertyuiop[]asdfghjkl;'zxcvbnm,./"
val ru = "Ё!\"№;%:?*()ЙЦУКЕНГШЩЗХЪ/ФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,ёйцукенгшщзхъфывапролджэячсмитьбю."
val biMap: BiMap<Char, Char> by lazy {
eng.zip(ru).toMap().toBiMap()
}
import subprocess as sp
f_width = 1024
f_height = 576
f_channels = 1
f_batch_size = 1
command = [ "ffmpeg",
'-i', '/home/veon/Downloads/BybanenBareFront.1024x576p50.h264.Nrk.mp4',
'-f', 'image2pipe',
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
import matplotlib.pyplot as plt
import tensorflow as tf
from IPython.display import Image
filename = "/home/veon/temp/kcaptcha/generate/*.png"
filename_queue = tf.train.string_input_producer(tf.train.match_filenames_once(filename))
reader = tf.WholeFileReader()
key, value = reader.read(filename_queue)
@veonua
veonua / Log.java
Created July 21, 2016 19:45
Logentries helper
package com.example;
import com.logentries.logger.AndroidLogger;
import static android.util.Log.getStackTraceString;
/**
* Logentries Proxy
*/
public class Log {