wing-ops/prediction/image/mx15hdi/Detect/mmsegmentation/configs/ocrnet/README.md
jeonghyo.k 3946ff6a25 feat(prediction): 이미지 분석 서버 Docker 패키징 + DB 코드 제거
- prediction/image/ FastAPI 서버 Docker 환경 구성
  - Dockerfile: PyTorch 2.1 + CUDA 12.1 기반 GPU 이미지
  - docker-compose.yml: GPU 할당 + 데이터 볼륨 마운트
  - requirements.txt: 서버 의존성 목록
  - .env.example: 환경변수 템플릿
  - DOCKER_USAGE.md: 빌드/실행/API 사용법 문서
  - Dockerfile에 .dockerignore 제외 폴더 mkdir -p 추가
- .gitignore: prediction/image 결과물 및 모델 가중치(.pth) 제외 추가
- dbInsert_csv.py, dbInsert_shp.py 삭제 (미사용 DB 로직)
- api.py: dbInsert import 및 주석 처리된 DB 호출 코드 제거
- aerialRouter.ts: req.params 타입 오류 수정
2026-03-10 18:37:36 +09:00

20 KiB

OCRNet

Object-Contextual Representations for Semantic Segmentation

Introduction

Official Repo

Code Snippet

Abstract

In this paper, we address the problem of semantic segmentation and focus on the context aggregation strategy for robust segmentation. Our motivation is that the label of a pixel is the category of the object that the pixel belongs to. We present a simple yet effective approach, object-contextual representations, characterizing a pixel by exploiting the representation of the corresponding object class. First, we construct object regions based on a feature map supervised by the ground-truth segmentation, and then compute the object region representations. Second, we compute the representation similarity between each pixel and each object region, and augment the representation of each pixel with an object contextual representation, which is a weighted aggregation of all the object region representations according to their similarities with the pixel. We empirically demonstrate that the proposed approach achieves competitive performance on six challenging semantic segmentation benchmarks: Cityscapes, ADE20K, LIP, PASCAL VOC 2012, PASCAL-Context and COCO-Stuff. Notably, we achieved the \nth{2} place on the Cityscapes leader-board with a single model.

Citation

@article{YuanW18,
  title={Ocnet: Object context network for scene parsing},
  author={Yuhui Yuan and Jingdong Wang},
  booktitle={arXiv preprint arXiv:1809.00916},
  year={2018}
}

@article{YuanCW20,
  title={Object-Contextual Representations for Semantic Segmentation},
  author={Yuhui Yuan and Xilin Chen and Jingdong Wang},
  booktitle={ECCV},
  year={2020}
}

Results and models

Cityscapes

HRNet backbone

Method Backbone Crop Size Lr schd Mem (GB) Inf time (fps) mIoU mIoU(ms+flip) config download
OCRNet HRNetV2p-W18-Small 512x1024 40000 3.5 10.45 74.30 75.95 config model | log
OCRNet HRNetV2p-W18 512x1024 40000 4.7 7.50 77.72 79.49 config model | log
OCRNet HRNetV2p-W48 512x1024 40000 8 4.22 80.58 81.79 config model | log
OCRNet HRNetV2p-W18-Small 512x1024 80000 - - 77.16 78.66 config model | log
OCRNet HRNetV2p-W18 512x1024 80000 - - 78.57 80.46 config model | log
OCRNet HRNetV2p-W48 512x1024 80000 - - 80.70 81.87 config model | log
OCRNet HRNetV2p-W18-Small 512x1024 160000 - - 78.45 79.97 config model | log
OCRNet HRNetV2p-W18 512x1024 160000 - - 79.47 80.91 config model | log
OCRNet HRNetV2p-W48 512x1024 160000 - - 81.35 82.70 config model | log

ResNet backbone

Method Backbone Crop Size Batch Size Lr schd Mem (GB) Inf time (fps) mIoU mIoU(ms+flip) config download
OCRNet R-101-D8 512x1024 8 40000 - - 80.09 - config model | log
OCRNet R-101-D8 512x1024 16 40000 8.8 3.02 80.30 - config model | log
OCRNet R-101-D8 512x1024 16 80000 8.8 3.02 80.81 - config model | log

ADE20K

Method Backbone Crop Size Lr schd Mem (GB) Inf time (fps) mIoU mIoU(ms+flip) config download
OCRNet HRNetV2p-W18-Small 512x512 80000 6.7 28.98 35.06 35.80 config model | log
OCRNet HRNetV2p-W18 512x512 80000 7.9 18.93 37.79 39.16 config model | log
OCRNet HRNetV2p-W48 512x512 80000 11.2 16.99 43.00 44.30 config model | log
OCRNet HRNetV2p-W18-Small 512x512 160000 - - 37.19 38.40 config model | log
OCRNet HRNetV2p-W18 512x512 160000 - - 39.32 40.80 config model | log
OCRNet HRNetV2p-W48 512x512 160000 - - 43.25 44.88 config model | log

Pascal VOC 2012 + Aug

Method Backbone Crop Size Lr schd Mem (GB) Inf time (fps) mIoU mIoU(ms+flip) config download
OCRNet HRNetV2p-W18-Small 512x512 20000 3.5 31.55 71.70 73.84 config model | log
OCRNet HRNetV2p-W18 512x512 20000 4.7 19.91 74.75 77.11 config model | log
OCRNet HRNetV2p-W48 512x512 20000 8.1 17.83 77.72 79.87 config model | log
OCRNet HRNetV2p-W18-Small 512x512 40000 - - 72.76 74.60 config model | log
OCRNet HRNetV2p-W18 512x512 40000 - - 74.98 77.40 config model | log
OCRNet HRNetV2p-W48 512x512 40000 - - 77.14 79.71 config model | log