Base Line/python 기초 코드
-
blender python scriptBase Line/python 기초 코드 2022. 6. 7. 11:50
블랜더에서 파이썬을 이용하여 매쉬의 절대 위치 바꾸기 블랜더의 좌표계는 Global Local Normal Gimbal 이렇게 나뉜다 매쉬를 이동시키기 위해선 global과 local좌표계가 필요하다 global 좌표계는 흔히 우리가 생각하는 데카르트좌표계 => x축, y축, z축 이 있는 그리드를 의미함 local 좌표계는 각 객체(매쉬 object)에서 정의된 좌표계를 뜻한다. 매쉬의 자료형태가 local로 정의 되어 있기 때문에 local의 vertecs를 다 읽은뒤 그것을 global 좌표계로 변환 해주어야한다. ##########주의########### #블랜더 버전에 따라서 표현이 바뀐게 많음 #elementwise 곱 *==>@ #cursor_location ==>cursor.location..
-
pcl + open3dBase Line/python 기초 코드 2022. 6. 6. 18:35
https://github.com/strawlab/python-pcl GitHub - strawlab/python-pcl: Python bindings to the pointcloud library (pcl) Python bindings to the pointcloud library (pcl). Contribute to strawlab/python-pcl development by creating an account on GitHub. github.com 포인트 클라우드용 라이브러리 우분투 내장되어있다고 한다~~ 중간에 yaml 깔라고 할수도 있음 pip install pyyaml 그치만 역시나 내컴에서는 정성스럽게 빌드해줘야 실행된다는거;; pip install cython git clone https..
-
pillow 이미지 rotation, flipBase Line/python 기초 코드 2022. 4. 18. 21:43
from PIL import Image import os import glob import random #플립하고, 로테이션(15도) 따라서, 원 데이터에서 4배 #글로브로 다부르기 #C:\Users\user\Downloads\datasets\datasets\Image_test_rmove ############################################################################### data_root = "C:\\Users\\user\\Downloads\\Image_train_remove" ############################################################################### #glob.glob(os.p..
-
data_loaderBase Line/python 기초 코드 2022. 4. 4. 15:29
# Created by ylab604 # ------------------------------------------------------------------------------ import os import random import glob import torch import torch.utils.data as data import pandas as pd from PIL import Image, ImageFile import numpy as np import torchvision.transforms as transforms from lib.utils.transforms import fliplr_joints, crop, generate_target, transform_pixel ImageFile.LO..
-
Depth_Render.pyBase Line/python 기초 코드 2022. 3. 16. 08:23
##Depth_Render.py """ 무수한 주석처리 양해좀 ㅎㅎ """ import torch.nn as nn import torch #from engineer.render.PIFuhd import gl # 기본으로 해줘야됨 from .Base_Render import _Base_Render # 노말 체크 from .registry import NORMAL_RENDER # face3D from engineer.render.face3d import mesh import numpy as np from PIL import Image ######check from math import cos, sin def similarity_transform(vertices, s, R, t3d): ''' similarit..
-
open3d extract depth map from meshBase Line/python 기초 코드 2022. 3. 14. 22:16
별의별것을 다해봤던거 같다 그나마 가장 깔끔하고 자동화 가능할 거 같은 open3d 라이브러리가 나은 거 같다. 이럴때면 누가 옆에서 알려줬으면... ㅋㅋ import open3d as o3d import math import os import camera import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np #import open3d import cv2 as cv #import loader.loader as load #from PIL import Image smplpath="C:\\Users\\user\\Desktop\\normal\\0003.obj" filepath,fullflname = os.path.s..
-
path & osBase Line/python 기초 코드 2022. 3. 9. 19:12
import os import glob ##first folder transform to 0000_OBJ file_path="C:\\Users\\user\\Downloads\\THuman2.0_Release" file_names = os.listdir(file_path) print(file_names) for name in file_names: input = os.path.join(file_path,name) output = name+'_OBJ' output = os.path.join(file_path,output) os.rename(input,output) file_path="C:\\Users\\user\\Downloads\\THuman2.0_Release" file_names = os.listdir(..
-
NumpyBase Line/python 기초 코드 2022. 2. 21. 15:07
Numpy(Numerical python) np.array 함수를 사용하여 배열 생성 리스트와는 다르게 하나의 데이터 type만 배열에 사용가능 => dynamic typing not supported 리스트는 객체들의 레퍼런스의 모임이지만 배열은 한개의 객체임 import numpy as np a=np.array([1,2,3,4],float) print(a) #astype()메써드로 바꾸기가능 b=a.astype(np.int16) print(b.dtype) [1. 2. 3. 4.] int16 shape 넘파이 배열 차원의 구성을 반환함 // 차원의 길이를 의미 dtype 넘파이 배열 데이터 타입 반환 ndim (number of dimension) 몇차원인지 의미 size 원소개수 import nump..