Skip to content

Instantly share code, notes, and snippets.

View jangsoopark's full-sized avatar
:octocat:
asdf

jangsoo park jangsoopark

:octocat:
asdf
View GitHub Profile
@linrock
linrock / rgb_to_yuv_and_back_to_rgb.py
Last active May 16, 2024 04:05
Color inaccuracies from converting 24-bit RGB -> YUV -> 24-bit RGB (BT.709)
""" This simulates converting 24-bit RGB values to YUV, then back to 24-bit RGB.
Using BT.709 transfer functions:
https://en.wikipedia.org/wiki/Rec._709
It demonstrates that converting to 30-bit YUV then back to 24-bit RGB is lossy.
Using 10 bits per YUV value appears to be lossless.
Converting RGB (24-bit) -> YUV (64-bit floats per channel, normalized [0-1]) -> RGB (24-bit)
Found 0 inaccurate conversions out of 16581375 RGB values
@hiorws
hiorws / face-detection.py
Created May 12, 2020 16:43 — forked from bookjan/face-detection.py
Using python opencv to detect face and send the frames to FFmpeg to create HLS(HTTP Live Streaming)
import numpy as np
import cv2
import sys
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier('<PATH_TO_CASCADES_FOLDER>/haarcascade_frontalface_default.xml')
while(True):
# Capture frame-by-frame
@justanhduc
justanhduc / pc2voxel.py
Last active July 17, 2024 17:46
PyTorch pointcloud to voxel
import neuralnet_pytorch as nnt
import torch as T
from torch_scatter import scatter_add
def pointcloud2voxel_fast(pc: T.Tensor, voxel_size: int, grid_size=1., filter_outlier=True):
b, n, _ = pc.shape
half_size = grid_size / 2.
valid = (pc >= -half_size) & (pc <= half_size)
valid = T.all(valid, 2)
@kaz3w
kaz3w / resolve_meta_release_lts_check_error.sh
Created May 12, 2019 08:46
Ubuntu 18. Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
sudo rm /var/lib/ubuntu-release-upgrader/release-upgrade-available
sudo /usr/lib/ubuntu-release-upgrader/release-upgrade-motd
@luncliff
luncliff / cmake-tutorial.md
Last active July 16, 2024 13:09
CMake 할때 쪼오오금 도움이 되는 문서

CMake를 왜 쓰는거죠?
좋은 툴은 Visual Studio 뿐입니다. 그 이외에는 전부 사도(邪道)입니다 사도! - 작성자

주의

  • 이 문서는 CMake를 주관적으로 서술합니다
  • 이 문서를 통해 CMake를 시작하기엔 적합하지 않습니다
    https://cgold.readthedocs.io/en/latest/ 3.1 챕터까지 따라해본 이후 기본사항들을 속성으로 익히는 것을 돕기위한 보조자료로써 작성되었습니다
@godber
godber / 3dhist.py
Last active November 15, 2018 14:08
3D Histogram of an image in Python using VisPy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Generates 3D Histogram of Wallaby image and renders to screen using vispy
Requires:
vispy
scipy
numpy
@JonathonReinhart
JonathonReinhart / ctypes_structs_example.py
Last active November 4, 2022 13:39
Using Python ctypes to manipulate binary data
#!/usr/bin/env python3
from __future__ import print_function
from tempfile import TemporaryFile
from binascii import hexlify
from ctypes import *
class StructHelper(object):
def __get_value_str(self, name, fmt='{}'):
val = getattr(self, name)
@InnerPeace-Wu
InnerPeace-Wu / tf_gradient_clip_lr_decay.py
Created October 5, 2017 11:21
ways to do gradients clipping and learning rate decay in tensorflow
import tensorflow as tf
#aplly exponential decay on learning rate
global_step = tf.Variable(0, trainable=False)
stater_learning_rate = lr #for start
learning_rate = tf.train.exponential_decay(starter_learning_rate, global_step,
decay_steps, decay_rate, staircase=True)
optimizer = tf.train.AdamOptimizer(learning_rate)
@kanhua
kanhua / README.md
Last active February 1, 2023 17:08
A template of writing C or C++ extension for python and numpy

This gist demonstrates how to setup a python project that process a numpy array from C language.

To compile the project, run

make all

To test it, run

make test
@allieus
allieus / README.md
Last active January 20, 2021 02:23
네이버 블로그 크롤링

네이버 블로그 크롤링

  • 파이썬3 에서 동작합니다.
  • requests, beautifulsoup4 라이브러리가 필요합니다.
pip install requests beautifulsoup4

AskDjango