Skip to content

Instantly share code, notes, and snippets.

@xoiga123
xoiga123 / compare_opencv_zed.py
Last active September 30, 2022 10:05
compare raw yuv stream to rgb stream from zed sdk
# https://stackoverflow.com/questions/39040944/convert-yuv444-to-yuv422-images
# https://stackoverflow.com/questions/58293187/opencv-real-time-streaming-video-capture-is-slow-how-to-drop-frames-or-get-sync
# v4l2-ctl --set-fmt-video=width=1344,height=376,pixelformat=0 && v4l2-ctl --set-parm=100
import cv2
import numpy as np
import pyzed.sl as sl
import time
from threading import Thread
frames_to_read = 100
@xoiga123
xoiga123 / bookmarklet.js
Last active August 19, 2022 10:27
Label Studio Textarea Bookmarklet
// <textarea> in Label Studio requires A MOUSE CLICK to focus, ain't nobody got time for that
$('body').keydown((e) => (e.which==190) ? setTimeout(() => $("textarea[name='transcription']").focus(), 50) : console.log('aaa') )
// 190 is this character: . (period)
// because alt+. is move to next region => automatically focus on the textarea that appears
// for another key: https://css-tricks.com/snippets/javascript/javascript-keycodes/
// as a bookmarklet:
// javascript: (() => { $('body').keydown((e) => (e.which==190) ? setTimeout(() => $("textarea[name='transcription']").focus(), 50) : console.log('aaa') ) })();
@xoiga123
xoiga123 / gradient-flow.ipynb
Created July 7, 2022 06:31
gradient flow.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xoiga123
xoiga123 / test_thread.py
Created July 6, 2020 14:27
simple multithread with tkinter
import tkinter as tk
import threading
import time
def loop():
while True:
print('from loop')
time.sleep(1)