Skip to content

Instantly share code, notes, and snippets.

@oiehot
oiehot / composite.py
Created October 1, 2017 06:15
Building Photoshop layers with Python
import os
import comtypes.client
app = comtypes.client.CreateObject('Photoshop.Application.60') # CS6
# maya config
project_path = 'd:/project/alice/maya'
log_path = project_path + '/log'
images_path = project_path + '/images'
layers = ['master', 'prop_matte', 'shadow', 'wall_matte']
passes = ['beauty', 'N']
@oiehot
oiehot / naver_cafe_crawler_wip.py
Created November 4, 2017 04:38
Naver cafe crawler (wip)
from selenium import webdriver
class Article():
def __init__(self, id, title, author, date, view_count=0, like_count=0, contents=''):
self.id = id
self.title = title
self.author = author
self.date = date
self.view_count = view_count
self.like_count = like_count
@oiehot
oiehot / tf_estimator_custom.py
Created November 10, 2017 23:35
Tensorflow Custom Estimator
import numpy as np
import tensorflow as tf
# 커스텀 Estimator 모델(func)
def model_fn(features, labels, mode):
W = tf.get_variable('W', [1], dtype=tf.float64) # tf.get_variable(): Gets an existing variable with parameter or create a new one.
b = tf.get_variable('b', [1], dtype=tf.float64)
y = W * features['x'] + b
# loss(오차) 서브 그래프
@oiehot
oiehot / py_mqtt_1.py
Created March 25, 2019 06:55
py_mqtt_1.py
# https://mosquitto.org
# https://www.vultr.com/docs/how-to-install-mosquitto-mqtt-broker-server-on-ubuntu-16-04
# https://pypi.org/project/paho-mqtt/
# http://www.steves-internet-guide.com/into-mqtt-python-client/
# $ mosquitto_pub -t "house/main-light" -m "message from mosquitto_pub client" -u "oiehot" -P "*******"
import time
import paho.mqtt.client as mqtt
ID = 'oiehot'
@oiehot
oiehot / unreal_maya_art_rig.md
Created December 16, 2018 05:07
unreal_maya_art_rig.md

마야 언리얼 ART

설치하기

  1. 마켓플레이스에서 ARTv1을 구입하고 다운로드 한다.

  2. C:/Program Files/Epic Games/UE_4.20/Engine/Plugins/Marketplace/ARTv1/MayaTools

  3. ARTv1/MayaTools를 다른 곳으로 카피한다.] 예) D:/ARTv1/MayaTools

@oiehot
oiehot / AAPawn.cpp
Created December 16, 2018 04:52
AAPawn.cpp
#include "ABPawn.h"
AABPawn::AABPawn()
{
PrimaryActorTick.bCanEverTick = true;
Capsule = CreateDefaultSubobject<UCapsuleComponent>(TEXT("CAPSULE"));
Mesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("MESH"));
Movement = CreateDefaultSubobject<UFloatingPawnMovement>(TEXT("MOVEMENT"));
SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SPRINGARM"));
@oiehot
oiehot / copyrighter.py
Created December 16, 2018 04:47
copyrighter.py
import os
import sys
import re
from PIL import Image, ImageDraw, ImageFont
from PyQt5.QtWidgets import *
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import QEvent
from datetime import datetime
from os.path import getmtime
@oiehot
oiehot / alphaavantage.py
Created December 16, 2018 04:41
alphaavantage.py
import io
import requests
import pandas as pd
import json
# https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=MSFT&apikey=demo
# https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=MSFT&outputsize=full&apikey=demo
# https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=MSFT&apikey=demo&datatype=csv
apikey = 'API_KEY_HERE'
@oiehot
oiehot / tf_iris_classification.py
Created November 11, 2017 13:11
Tensorflow 심층신경망(DNN)을 이용하여 꽃 분류하기
'''
Tensorflow 심층신경망(DNN)을 이용하여 꽃 분류하기 (Classification)
순서:
1. CSV로 부터 Iris 훈련/시험 데이터를 읽는다.
2. 분류하는 신경망을 만든다.
3. 데이터를 통한 훈련.
4. 새로운 샘플을 통해 판별하기.
SL SW PL PW species
@oiehot
oiehot / tf_estimator_linear_regressor.py
Created November 10, 2017 23:33
Tensorflow LinearRegressor
import numpy as np
import tensorflow as tf
x = tf.feature_column.numeric_column('x', shape=[1]) # 랭크 1 텐서, 1차원 배열
feature_columns = [x]
# LinearRegressor < tf.estimator.Estimator
estimator = tf.estimator.LinearRegressor(feature_columns=feature_columns)
# 데이터 세트