> For the complete documentation index, see [llms.txt](https://pcl.gitbook.io/tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pcl.gitbook.io/tutorial/part-3/part03-chapter01/part03-chapter01-pointgan.md).

# PointGAN (90%)

> ubuntu 18, python3.6.7

## 1. 설치

```
$ sudo apt-get install python3-opencv python3-tk
$ pip3 install http://download.pytorch.org/whl/cu80/torch-0.1.11.post5-cp27-none-linux_x86_64.whl 
$ pip3 install torchvision progressbar2


$ cd ~
$ git clone https://github.com/fxia22/pointGAN.git
$ cd pointGAN

$ bash build.sh #build C++ code for visualization
$ bash download.sh #download dataset
```

## 2. 모델 생성

```
$ python3 show_gan.py --model gan/modelG_10.pth # choose your own model
```

> 필요시 주석 처리 `print('[%d: %d/%d] train lossD: %f lossG: %f' %(epoch, i, num_batch, lossD.data[0], lossG.data[0]))`

## 3. 데이터 생성

```
python3 show_gan.py --model gan/modelG_3.pth
```

> 필요시 수정 `gen = PointGen(num_points = 2500)`

## 4. 사용자 학습 데이터 활용

1. synsetoffset2category.txt에 `폳더명, Label명 추가` eg. `7777`, `human`
2. `train_gan.py`의 `class_choice` 를 label명으로 수정 eg. `class_choice = ['human']`

![](https://2464378616-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlRnV1ClOlzTrRLelUV%2F-LlRo06vVeUmlBi-jJfn%2F-LlRo7jmBtumAF574qav%2FPart03-Chapter01-PointGAN.gif?generation=1564925278785797\&alt=media)

* [pointGAN](https://github.com/fxia22/pointGAN)
* [ShapeNet 학습 데이터](https://github.com/hunjung-lim/awesome-vehicle-datasets/blob/master/Object/shpaenet/README.md)
