Skip to content

Instantly share code, notes, and snippets.

View RyanKor's full-sized avatar
🎯
Focusing

SeungTaeKim RyanKor

🎯
Focusing
View GitHub Profile
# train/test 경로에 따른 이미지 파일 확인
# training image 폴더명 : 파일명 형태로 정리
train_file = {}
val_file = os.listdir(validation_dir)
for folder in os.listdir(train_dir):
train_file[folder] = os.listdir(train_dir + folder)
print(len(os.listdir(validation_dir)))
print(os.listdir(train_dir))
@RyanKor
RyanKor / dir.py
Created September 24, 2021 09:55
# 훈련 이미지 디렉토리 설정
base_dir = './tmp'
train_dir = os.path.join(base_dir, 'train/train/')
validation_dir = os.path.join(base_dir, 'test/test/0/')
@RyanKor
RyanKor / zip.py
Created September 24, 2021 09:49
# 다운로드 받은 이미지 압축 파일 해제
local_zip = './train.zip'
zip_ref = zipfile.ZipFile(local_zip, 'r')
zip_ref.extractall('tmp/train')
zip_ref.close()
local_zip = './test.zip'
zip_ref = zipfile.ZipFile(local_zip, 'r')
!python --version
# !pip install tensorflow-datasets==4.3.0 Pillow==8.2.0 pandas==1.2.4
# TF Certificate 권장 모듈 설정
import tensorflow as tf
import tensorflow_datasets as tfds
import pandas as pd
import numpy as np
import scipy
import PIL
# Tf Certificate 권장 모듈 끝
@RyanKor
RyanKor / dev.py
Created September 12, 2021 16:17
# 파이썬 3.8.0으로 버전 변경하기
!wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
!tar xvfz Python-3.8.0.tgz
!Python-3.8.0/configure
!./configure
!make
!sudo make install
!pip3 list
!python --version
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class HauntedBus:
def __init__(self, passengers=None):
if passengers is None:
self.passengers = []
else:
self.passengers = list(passengers)
def pick(self, name):
self.passengers.append(name)
class HauntedBus:
def __init__(self, passengers=[]):
self.passengers = passengers
def pick(self, name):
self.passengers.append(name)
def drop(self, name):
self.passengers.remove(name)
class Gizmo:
def __init__(self):
print("Gizmo id: %d" % id(self))
x = Gizmo()
# Gizmo id : 4301489152
y = Gizmo() * 10
# Gizmo id : 4301489432
@RyanKor
RyanKor / label.py
Created September 6, 2021 12:20
Fluent Python
a = [1,2,3]
b = a
a.append(4)
print(b) # result : [1,2,3,4]