Cobra
[Pattern Recognition] Official Pytorch Code for CoBra ๐ : Complementary Branch Fusing Class and Semantic Knowledge for Robust Weakly Supervised Semantic Segmentation
Install / Use
/learn @MICV-yonsei/CobraREADME
CoBra ๐ : Complementary Branch Fusing Class and Semantic Knowledge for Robust Weakly Supervised Semantic Segmentation

We propose Complementary Branch (CoBra), a novel dual branch framework consisting of two distinct architectures which provide valuable complementary knowledge of class (from CNN) and semantic (from vision transformer) to each branch. In particular, we learn Class-Aware Projection (CAP) for the CNN branch and Semantic-Aware Projection (SAP) for the vision transformer branch to explicitly fuse their complementary knowledge and facilitate a new type of extra patch-level supervision. Extensive experiments qualitatively and quantitatively investigate how CNN and vision transformer complement each other on the PASCAL VOC 2012 dataset showing a state-of-the-art WSSS result.
:book: Contents
<!--ts--> <!--te-->๐ง Prerequisite
- Download PASCAL VOC2012 devkit
- Ubuntu 20.04, with Python 3.10 and the following python dependencies.
pip install -r requirements.txt
๐ป Usage
Step1:
-
Run the run.sh script for training Cobra, it makes Seed and elements for making better Mask.
-
We train IRNet to generate mask to refine Seed.
-
change
titleandpascal_dataset_pathin run shell script.
bash run.sh
๐๏ธ Pretrained Weight
<table style="margin: auto"> <tr> <td align="center">CAK Branch</td> <td align="center"><i>ep19_cnn_checkpoint.pth</i></td> <td><a href="https://drive.google.com/file/d/1X0kn_imyesfKlguBWqoysar5_4RWMFZ1/view?usp=sharing](https://drive.google.com/drive/folders/1ZUCTrz7J4eCUrMTLgbaqHEJqqW_ZYamy?usp=sharing">link</td> </tr> <tr> <td align="center">SAK Branch</td> <td align="center"><i>ep19_tran_checkpoint.pth</i></td> <td><a href="https://drive.google.com/file/d/1GAEO-Qta_iUnR1ptZL7z5ZTiCuTA9QWx/view?usp=sharing](https://drive.google.com/drive/folders/1ZUCTrz7J4eCUrMTLgbaqHEJqqW_ZYamy?usp=sharing">link</td> </tr> </table>Step2: For the Segmentation part, we used DeepLabV2 with resnet101 backbone and MiT-B2 backbone.
- DeepLabV2 (https://github.com/kazuto1011/deeplab-pytorch)
๐ About CoBra
<center><img src="./img/main.png" width="700px" height="700px" title="Github_Logo"/> </center>Results
-
Qualitative Results on Pascal VOC 2012 dataset.

-
Qualitative Results on MS-COCO 2014 dataset.

:scroll: Acknowledgement
This repository has been developed based on the IRNet repository. Thanks for the good work!
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot ๅฏๅชไฝๆถๅ่ฝๅใไฝฟ็จ <qqmedia> ๆ ็ญพ๏ผ็ณป็ปๆ นๆฎๆไปถๆฉๅฑๅ่ชๅจ่ฏๅซ็ฑปๅ๏ผๅพ็/่ฏญ้ณ/่ง้ข/ๆไปถ๏ผใ
