Skip to content

Instantly share code, notes, and snippets.

View webtk's full-sized avatar
💭
I may be slow to respond.

Taekyung Lee webtk

💭
I may be slow to respond.
  • Daejeon, South Korea
View GitHub Profile
@webtk
webtk / extract_polygon_from_rendered_ai.py
Created September 29, 2022 08:15
Extraction polygon from annotation data of rendered.ai(synthetic dataset)
from PIL import ImageDraw as D
from PIL import Image
from PIL import ImagePath
import json
with open('syn_sample/annotations/0000000000-1-Image-ana.json','r') as f:
annotation = json.load(f)
i = Image.open("syn_sample/images/0000000000-1-Image.png")
draw = D.Draw(i)
objects = annotation['annotations']
@webtk
webtk / extract_rbox_from_rendered_ai.py
Created September 29, 2022 08:13
extraction RBox from Rendered.ai Annotation data
from PIL import ImageDraw as D
from PIL import Image
from PIL import ImagePath
import json
import cv2
import numpy as np
with open('syn_sample/annotations/0000000000-1-Image-ana.json','r') as f:
annotation = json.load(f)
i = Image.open("syn_sample/images/0000000000-1-Image.png")
@webtk
webtk / object_bbox_extraction_from_rendered_ai_dataset.py
Last active September 29, 2022 08:11
Tried to extract bbox from 'Rendered.ai' Dataset.
from PIL import ImageDraw as D
from PIL import Image
from PIL import ImagePath
import json
with open('syn_sample/annotations/0000000000-1-Image-ana.json','r') as f:
annotation = json.load(f)
i = Image.open("syn_sample/images/0000000000-1-Image.png")
draw = D.Draw(i)
objects = annotation['annotations']
@webtk
webtk / gist:3e7aa15bc20c4f16d8215a3f245ca0e7
Created July 28, 2018 06:10
Python Django Admin Auto Register Model Simply
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered
def load_fields(model):
field_list = [f.name for f in model._meta.get_fields() if f.auto_created == False]
return field_list
@webtk
webtk / gist:a6bca8d9eb3842581324925375761ed2
Created July 28, 2018 06:06
C# Get Hashcode Simply Short
// https://stackoverflow.com/questions/23468671/what-is-the-best-way-to-implement-gethashcode-for-class-with-lots-of-propertie
public static class HashCodeByPropertyExtensions
{
public static int GetHashCodeOnProperties<T>(this T inspect)
{
return inspect.GetType().GetProperties().Select(o => o.GetValue(inspect, null)).GetListHashCode();
}
public static int GetListHashCode<T>(this IEnumerable<T> sequence)
{
@webtk
webtk / split_into_multi_rows.vba
Last active January 10, 2018 07:05
An excel macro for splitting cell has multiple newlines into multiple rows
Sub split_into_multi_rows()
'splits Text active cell
Dim splitVals As Variant
Dim totalVals As Long
splitVals = Split(ActiveCell.Value, Chr(10))
totalVals = UBound(splitVals)
'insert rows and delete active row
@webtk
webtk / CreatePowerPoint.cs
Created April 12, 2016 10:01
Create PowerPoint(C#)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Core;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;