일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- ConvGRU
- 머신러닝
- 데이터셋 자동 생성
- Blenderproc
- 카메라 내부파라미터 #c++
- Unity
- Ceres-solver
- ubuntu 20.04
- SfM의 의존성
- 가상데이터셋
- RTX3090TI
- 명령어모음
- 6D Pose estimation
- Ceres
- 데이터셋
- Nerf
- 딥러닝 데이터셋
- instant-ngp
- 라이브러리 설치
- Photogrammetry
- 데이터셋생성
- 자세추정
- 딥러닝
- RNNPose
- python 코드
- OpenSfM
- ROS2 #설치 #우분투20.04 #
- gru
- 사진으로 3D 모델링 하기
- 블랜더
- Today
- Total
홍든램지의 보일러실
BlenderProc 설치와 python 예시 본문
BlenderProc를 통해 대규모 데이터셋을 구성하기 위해서는 블랜더를 설치해야한다.
1. 블렌더 다운로드
https://www.blender.org/download/
Download — blender.org
The Freedom to Create.
www.blender.org
BlenderProc는 블렌더 3D모델링 소프트웨어 위에 구축된다. 다라서 먼저 블렌더를 다운로드하고 설치해야 한다. 블랜더 공식 웹사이트에서 최신 버전의 블랜더를 사운로드 할수 있다.
2.BlenderProc 설치:
방법에는 두가지가 있다.
2-1. pip 를 이용해서 설치하는 방법
pip install blenderproc
위 커맨드를 통해서 pip package로 설치가 가능하다.
2-2. Git clone 을 통한 방법
블렌더를 설치하면 공식 Github 리포지토리에서 최신 버전의 BlenderProc을 다운받을수 있다. 운영체제의 경우 Window, Linux or macOS에 적합하다.
https://github.com/DLR-RM/BlenderProc
GitHub - DLR-RM/BlenderProc: A procedural Blender pipeline for photorealistic training image generation
A procedural Blender pipeline for photorealistic training image generation - GitHub - DLR-RM/BlenderProc: A procedural Blender pipeline for photorealistic training image generation
github.com
필자는 Ubuntu에서 사용하고 있으며 아래 명령어를 통해 설치한다.
git clone https://github.com/DLR-RM/BlenderProc.git

주의: blenderproc 명령을 사용하여 시스템 모든 위치에서 blenderproc를 사용하려면 local pip에 설치되어야한다.
cd BlenderProc
pip install -e .
BlenderProc 디렉토리로 이동하여 설치를 진행한다.
간단한 예시로
import blenderproc as bproc
import numpy as np
bproc.init()
# Create a simple object:
obj = bproc.object.create_primitive("MONKEY")
# Create a point light next to it
light = bproc.types.Light()
light.set_location([2, -2, 0])
light.set_energy(300)
# Set the camera to be in front of the object
cam_pose = bproc.math.build_transformation_mat([0, -5, 0], [np.pi / 2, 0, 0])
bproc.camera.add_camera_pose(cam_pose)
# Render the scene
data = bproc.renderer.render()
# Write the rendering into an hdf5 file
bproc.writer.write_hdf5("[저장할경로]", data)
폴더를 하나 생성하고 아래 커맨드로 위 파이썬 파일을 실행한다.
cd [생성한 경로]
blenderproc run [파일이름].py
# 예시
cd project_py
blenderproc run test.py

해당결로에 생성된 파일을 시각화 해보자
blenderproc vis hdf5 0.hdf5

위와 같은 결과를 얻을 수 있다.
블랜더 GUI Debugging 모드도 사용 할 수 있다.
실질적으로 블랜더에서 어떻게 작동하는지 보기 위해서 debug 명령어를 사용해서 확인할 수 있다.
blenderproc debug test.py
위 명령어를 입력하게 되면 아래와 같은 화면으로 전환 되며 run blenderproc 를 클릭하면 실행할 수 있다.

이상으로 설치와 예제를 실행해보았다.
'오픈소스 프로젝트' 카테고리의 다른 글
[Unity Perception Package] 2.데이터셋 만들기 (0) | 2023.04.05 |
---|---|
[Unity Perception Package] 1.데이터셋 생성 준비하기 (0) | 2023.04.04 |
OpenSfM 알아보고 설치하고 실행하기 (0) | 2023.03.31 |
Ceres-solver 라이브러리 설치하고 예제로 확인하기 (0) | 2023.03.30 |