This is the official PyTorch implementation of our under review paper "Towards Language-guided Visual Recognition via Dynamic Convolutions". In this paper, we propose a compact and unified Vision-Language network, termed as LaConvNets. LaConvNets can unify the visual recognition and multi-modal reasoning in one forward structure with a novel language-guided convolution (LaConv). On 9 benchmarks, LaConvNets demonstrate better trade-offs between efficiency and performance than existing methods.
- (2023/4/13) Release our LaConvNet project.
pip install -r requirements.txt
wget https://github.com/explosion/spacy-models/releases/download/en_vectors_web_lg-2.1.0/en_vectors_web_lg-2.1.0.tar.gz -O en_vectors_web_lg-2.1.0.tar.gz
pip install en_vectors_web_lg-2.1.0.tar.gz
pip install cupy-cuda11x==11.6
- Follow the instructions of DATA_PRE_README.md to prepare the necessary training data.
- Prepare your settings. To train a model, you should modify
./config/config.yamlto adjust the settings you want. - Train the model. run
train.pyunder the main folder to start training:
python train.py --config ./config/config.yaml
- Test the model. Then, you can run
test.pyby
python test.py --eval-weights ./weights/det_best.pth
- Training log. Logs are stored in
./logsdirectory, which records the detailed training curve and accuracy per epoch. If you want to log the visualizations, please setLOG_IMAGEtoTrueinconfig.yaml.
We provide the results of LaConvNets on REC and RES. Results and pre-trained checkpoints are available in Model Zoo.
