# PU-GAN-A100 **Repository Path**: casesense/pu-gan-a100 ## Basic Information - **Project Name**: PU-GAN-A100 - **Description**: PU-GAN-A100 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-11-28 - **Last Updated**: 2023-06-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PU-GAN项目的A100卡适配 注意,首先需要下载`PU-GAN`模型文件,并上传至目录`data/train`中。`PU-GAN`模型文件下载云盘地址如下: > 链接:https://pan.baidu.com/s/11eOpm9lyB7Ch6MlsDU3qvg > 提取码:ts17 PU-GAN项目运行的视频演示链接:https://www.bilibili.com/video/BV1fY411W7U2/ ## 适配方法1 为了使PU-GAN项目能够在A100卡上运行,在本项目的 `Docker-A100`[目录下](./Docker-A100),编写了新版的Dockerfile。 同时,由于新镜像是基于英伟达官方维护的A100适配版tf1.x Docker镜像`nvcr.io/nvidia/tensorflow:21.11-tf1-py3`制作的,cudart库及cuda_runtime.h头文件的路径与PU-GAN原项目所使用的环境不一致,因此在 `tf_ops/`目录下各个子目录中,对编译项目的Shell脚本文件(.sh)做了修改,添加了cudart路径`-L/usr/local/cuda-11.5/targets/x86_64-linux/lib/`,以及头文件路径`-I/usr/local/cuda-11.5/targets/x86_64-linux/include/`。 适配后的Docker使用方式参考[本说明](./Docker-A100)。 ## 适配方法2 第2种方法是直接使用英伟达官方镜像运行PU-GAN项目,使用方法如下: ``` docker pull nvcr.io/nvidia/tensorflow:21.11-tf1-py3 docker run -it --rm \ -e DISPLAY=unix$DISPLAY \ -v $(pwd):/workspace/ \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -w /workspace \ --name pu-gan-runtime \ --gpus all \ --shm-size 8G \ nvcr.io/nvidia/tensorflow:21.11-tf1-py3 bash bash_file.sh cd tf_ops; bash compile.sh; cd .. python pu_gan.py --phase train ``` --- 原版README内容如下: --- # PU-GAN: a Point Cloud Upsampling Adversarial Network by [Ruihui Li](https://liruihui.github.io/), [Xianzhi Li](https://nini-lxz.github.io/), [Chi-Wing Fu](http://www.cse.cuhk.edu.hk/~cwfu/), [Daniel Cohen-Or](https://www.cs.tau.ac.il/~dcor/), [Pheng-Ann Heng](http://www.cse.cuhk.edu.hk/~pheng/). ### Introduction This repository is for our ICCV 2019 paper '[PU-GAN: a Point Cloud Upsampling Adversarial Network](https://liruihui.github.io/publication/PU-GAN/)'. The code is modified from [3PU](https://github.com/yifita/3PU) and [PU-Net](https://github.com/yulequan/PU-Net). ### Docker A Dockerfile is provided to help you relief the pain of configurate training environment. See the instructions in [here](./Docker). ### Installation This repository is based on Tensorflow and the TF operators from PointNet++. Therefore, you need to install tensorflow and compile the TF operators. For installing tensorflow, please follow the official instructions in [here](https://www.tensorflow.org/install/install_linux). The code is tested under TF1.11 (higher version should also work) and Python 3.6 on Ubuntu 16.04. For compiling TF operators, please check `tf_xxx_compile.sh` under each op subfolder in `code/tf_ops` folder. Note that you need to update `nvcc`, `python` and `tensoflow include library` if necessary. ### Note When running the code, if you have `undefined symbol: _ZTIN10tensorflow8OpKernelE` error, you need to compile the TF operators. If you have already added the `-I$TF_INC/external/nsync/public -L$TF_LIB -ltensorflow_framework` but still have ` cannot find -ltensorflow_framework` error. Please use 'locate tensorflow_framework ' to locate the tensorflow_framework library and make sure this path is in `$TF_LIB`. ### Usage 1. Clone the repository: ```shell https://github.com/liruihui/PU-GAN.git cd PU-GAN ``` 2. Compile the TF operators Follow the above information to compile the TF operators. 3. Train the model: First, you need to download the training patches in HDF5 format from [GoogleDrive](https://drive.google.com/open?id=13ZFDffOod_neuF3sOM0YiqNbIJEeSKdZ) and put it in folder `data/train`. Then run: ```shell cd code python pu_gan.py --phase train ``` 4. Evaluate the model: First, you need to download the pretrained model from [GoogleDrive](https://drive.google.com/open?id=12kWoB0-_tflq65RNpJEnNGTTwPXa6IOH), extract it and put it in folder 'model'. Then run: ```shell cd code python pu_gan.py --phase test ``` You will see the input and output results in the folder `data/test/output`. 5. The training and testing mesh files can be downloaded from [GoogleDrive](https://drive.google.com/open?id=1BNqjidBVWP0_MUdMTeGy1wZiR6fqyGmC). ### Evaluation code We provide the code to calculate the uniform metric in the evaluation code folder. In order to use it, you need to install the CGAL library. Please refer [this link](https://www.cgal.org/download/linux.html) and [PU-Net](https://github.com/yulequan/PU-Net) to install this library. Then: ```shell cd evaluation_code cmake . make ./evaluation Icosahedron.off Icosahedron.xyz ``` The second argument is the mesh, and the third one is the predicted points. ## Citation If PU-GAN is useful for your research, please consider citing: @inproceedings{li2019pugan, title={PU-GAN: a Point Cloud Upsampling Adversarial Network}, author={Li, Ruihui and Li, Xianzhi and Fu, Chi-Wing and Cohen-Or, Daniel and Heng, Pheng-Ann}, booktitle = {{IEEE} International Conference on Computer Vision ({ICCV})}, year = {2019} } ### Questions Please contact 'lirh@cse.cuhk.edu.hk'