Skip to content

Instantly share code, notes, and snippets.

View khengyun's full-sized avatar
👿
On the Nexus Timeline

Kang khengyun

👿
On the Nexus Timeline
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@khengyun
khengyun / ppm2image.py
Created September 24, 2023 21:04
convert all ppm file to image
import os
from PIL import Image
root_folder = "folder_path"
def convert_ppm_to_jpg(folder_path):
for root, dirs, files in os.walk(folder_path):
for filename in files:
if filename.endswith(".ppm"):
@khengyun
khengyun / image2ppm.py
Last active September 24, 2023 21:04
convert all image in a folder to ppm format
import os
from PIL import Image
root_folder = "folder_path"
def convert_image_to_ppm(folder_path):
for root, dirs, files in os.walk(folder_path):
for filename in files:
if filename.endswith((".png", ".jpg")):
@khengyun
khengyun / pid_controller.c
Last active September 18, 2023 22:36
pid controller + unitest
#include <stdio.h>
#include <time.h>
typedef struct {
double Kp;
double Ki;
double Kd;
double sample_time;
double current_time;
double last_time;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@khengyun
khengyun / anylabeling2masks.py
Created September 8, 2023 06:53
anylabeling to mask
import json
import os
from PIL import Image, ImageDraw
##############################################
# - image_label:
# - 1.json
# - 1.jpg
# - 2.json
# - 2.jpg

Setting up Webpack for any Typescript project from Scratch

Welcome to step by step hands-on guide to setup webpack in your upcoming typescript project. Please follow the steps and you should be able to create your own webpack project. Please download the source code from github.

You will learn below things:

  1. ✅Create a Typescript node.js project.
  2. ✅Install Dependencies with webpack & typescripts.
  3. ✅Use Webpack CLI to crate webpack.config.js file and modify webpack.config.js based on our need.
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten, Input
from keras.layers import Conv2D, MaxPooling2D, UpSampling2D
import matplotlib.pyplot as plt
from keras import backend as K
import numpy as np
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img