Skip to content

Instantly share code, notes, and snippets.

View choice17's full-sized avatar

Choi choice17

View GitHub Profile
@choice17
choice17 / convert.c
Last active March 21, 2022 01:11
neon color space conversion
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <time.h>
/* compile guide
// define color standard
// -DBT601 -DBT709 -DNARROW
@choice17
choice17 / lite_ut.h
Created November 19, 2021 11:08
light weight header unit test header framework in C
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
struct lite_test;
/**@brief struct for LiteTest
**/
typedef struct lite_test {
@choice17
choice17 / heatmap.py
Last active October 25, 2021 05:57
Gaussian heatmap generation
import random
import numpy as np
import matplotlib.pylab as plt
import os
import sys
import cv2
import argparse
np.set_printoptions(precision=4, suppress=True)
@choice17
choice17 / torch_dataset.py
Created September 11, 2021 08:09
A typical classification dataset fetching sample code
import torchvision.datasets.voc as voc
import torch
from torchvision.datasets import VisionDataset
from torchvision.datasets.vision import StandardTransform
import glob
import os
import numpy as np
import sys
class TinyImageNet(object):
@choice17
choice17 / yuv2gray_jpeg.py
Created September 8, 2021 03:02
yuv grayscale viewer using cv2
import cv2
import numpy as np
from PIL import Image
import sys
import glob
import os
import argparse
def info(*args, end=False):
if not end:
@choice17
choice17 / tflite_summary.py
Last active September 30, 2021 08:50
show model summary and tflite operators information
import sys
### require tflite >= v2.4.0
import tflite
import os
from collections import defaultdict
from datetime import datetime
### TFL3 schema compatible
ACTIVATION_DICT = {
0 : "NONE",