Base Line
-
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(..
-
이진 탐색Base Line/알고리즘 2022. 2. 22. 15:23
출처 : 이코테 순차탐색이란 리스트 안에 있는 특정한 데이터를 찾기 위해 앞에서부터 데이터를 하나씩 차례대로 확인하는 방법 def sequential_search(n,target,array): for i in range(n): if array[i]== target: return i + 1 print("생성할 원소 개수를 입력한 다음 한 칸 띄고 찾을 문자열을 입력하세요.") input_data = input().split() n = int(input_data[0]) target = input_data[1] array = input().split() print(sequential_search(n,target,array)) 이진 탐색 반으로 쪼개면서 탐색하기 변수 3개 사용 시작점, 끝점, 중간점 찾으려는 ..