# refseg_rrn **Repository Path**: cyanlaser/refseg_rrn ## Basic Information - **Project Name**: refseg_rrn - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-18 - **Last Updated**: 2021-11-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # (reproduce) Referring Image Segmentation via Recurrent Refinement Networks This codebase modified from [RRN official Repo](https://github.com/liruiyu/referseg_rrn). ## Setup This code derives from [TF-phrasecut-public](https://github.com/chenxi116/TF-phrasecut-public). Please follow its `Setup` and `Data Preparation` sections except that the DeepLab-ResNet backbone comes from [tensorflow-deeplab-resnet](https://github.com/DrSleep/tensorflow-deeplab-resnet). The pre-trained DeepLab-ResNet model can be downloaded from [here](https://github.com/DrSleep/tensorflow-deeplab-resnet#caffe-to-tensorflow-conversion). ### Install Runtime Packages 1. Install Runtime Environment: 1. conda create -n tf1.2 python=3.6; 2. conda install cudatoolkit=8.0; 3. conda install cudnn=5.1; 4. pip install tensorflow-gpu==1.2.1 2. pip install -r requirements.txt; ### Prepare backbone pretrained weights 1. visit official setup of [tensorflow-deeplab-resnet](https://github.com/DrSleep/tensorflow-deeplab-resnet#caffe-to-tensorflow-conversion); 2. open [google drive](https://drive.google.com/drive/folders/0B_rootXHuswsZ0E4Mjh1ZU5xZVU?resourcekey=0-9Ui2e1br1d6jymsI6UdGUQ) ; 3. Download `deeplab_resnet_init.ckpt` and put it into `data/weights/`; ### Install REFER API 1. cd `external/refer`; 2. Download `refclef`, `refcoco`, `refcoco+`, `refcocog` from: 1. https://bvisionweb1.cs.unc.edu/licheng/referit/data/refclef.zip 2. https://bvisionweb1.cs.unc.edu/licheng/referit/data/refcoco.zip 3. https://bvisionweb1.cs.unc.edu/licheng/referit/data/refcoco+.zip 4. https://bvisionweb1.cs.unc.edu/licheng/referit/data/refcocog.zip 3. make; ## Usage Before training, make sure `refer`, `cocoapi`, and `deeplab` are in `PYTHONPATH`. ``` export PYTHONPATH=./external/refer:./external/cocoapi/PythonAPI:./external/tensorflow-deeplab-resnet:$PYTHONPATH ``` To train a model on UNC dataset, run ``` python main_convlstm_p543.py -m train -d unc -t train -f ckpts/unc ``` To test the model with Dense CRF, run ``` python main_convlstm_p543.py -m test -d unc -t testA -f ckpts/unc -i 700000 -c ``` ## Thanks 1. official repo: https://github.com/liruiyu/referseg_rrn