This repository contains the code and supplementary materials for our paper titled "CRF-Net: Enhancing Semantic Segmentation using Conditional Random Fields and CNNs", which has been accepted at CVPR 2023 (Conference on Computer Vision and Pattern Recognition).
In this paper, we propose a novel deep learning approach for semantic segmentation, which aims to assign semantic labels to each pixel in an image. Our method combines the power of convolutional neural networks (CNNs) and conditional random fields (CRFs) to achieve highly accurate and detailed segmentation results. We demonstrate the effectiveness of our approach on various challenging datasets, showcasing its potential for real-world applications.
To install and set up the required dependencies, follow these steps:
- Clone this repository:
git clone https://github.com/daidshow/CRF-Net.git
- Install the necessary packages:
pip install -r requirements.txt
- Download the pretrained models: Download Link
- Unzip the pretrained models and place them in the
models/
directory.
To train and evaluate the semantic segmentation model, follow these instructions:
- Prepare your dataset by following the guidelines in
data_preparation.md
. - Run the training script:
python train.py --dataset /path/to/dataset --epochs 50
- Evaluate the trained model:
python evaluate.py --dataset /path/to/dataset --model /path/to/model.pth
- Generate segmentation predictions on new images:
python predict.py --image /path/to/image.jpg --model /path/to/model.pth
For more detailed usage instructions and options, please refer to the documentation.
Please download the datasets and follow the instructions in data_preparation.md
to preprocess the data.
We provide pretrained models for our approach, which can be downloaded from the following links:
To use the pretrained models, simply load them using torch.load()
in your own code.
If you find our work helpful in your research, please consider citing our paper: