GCNet-S (Cityscapes mirror)

type: mirror upstream: gyyang23/GCNet license: MIT pretrain: Cityscapes Cityscapes val: 76.9

This is a redistribution (a "mirror"), not a new model. The weights are the official GCNet-S Cityscapes checkpoint from gyyang23/GCNet, re-hosted here for convenient, stable, programmatic access via huggingface_hub. All credit to the original authors.

What this is

Architecture Golden Cudgel Network (CVPR 2025)
Variant S
Params / FLOPs ~9.2 M / 45.2 GFLOPs
Pretraining Cityscapes semantic segmentation, 19 classes (full fine-tuned checkpoint)
Reported metric 76.9 mIoU (single-scale) on Cityscapes val
Upstream repository https://github.com/gyyang23/GCNet
Upstream weights https://drive.google.com/file/d/1KersBP95k3b0AELiYlQ1rk4PKUmN-ueu/view
Upstream license MIT; mirrored as LICENSE in this repo

What was changed vs the upstream file

Nothing in the weights. The upstream .pth is an mmengine training checkpoint (weights + optimizer state + logging buffers). Only what is needed to load the model is kept:

Component Upstream This mirror
state_dict (model weights, fp32) yes yes, unchanged at top level
meta (mmengine env / config / dataset_meta) yes yes, kept for provenance
optimizer (SGD momentum buffers) yes removed
message_hub, param_schedulers yes removed
File size 182 MB ~84 MB

The tensors are byte-identical to the upstream file. checksums.txt in this repo carries the SHA-256 of the mirrored file and of the upstream original.

Usage

These weights use the mmsegmentation module layout. The GCNet backbone/head are registered by the vendored mmseg inside the upstream repo (stock pip install mmsegmentation does not have them), so install the repo's copy:

git clone https://github.com/gyyang23/GCNet
cd GCNet/mmsegmentation
pip install -v -e .          # registers GCNet / GCNetHead with mmseg
pip install huggingface_hub
cd ..                        # run from the repo root

Upstream environment: python==3.8, pytorch==1.12.1, mmcv==2.0.0, mmengine==0.10.2.

import numpy as np
from PIL import Image
from huggingface_hub import hf_hub_download
from mmseg.apis import init_model, inference_model

repo    = "dronefreak/gcnet-s-cityscapes"
config  = hf_hub_download(repo, "gcnet-s_4xb3-120k_cityscapes-1024x1024.py")   # mirrored from the upstream repo
weights = hf_hub_download(repo, "gcnet-s_cityscapes.pth")

model = init_model(config, weights, device="cuda:0")       # use "cpu" if no GPU

# --- inference on a single image ---
result = inference_model(model, "street.jpg")             # any RGB road-scene image
seg = result.pred_sem_seg.data[0].cpu().numpy().astype(np.uint8)   # (H, W), trainId 0..18

palette = np.array(model.dataset_meta["palette"], dtype=np.uint8)  # Cityscapes 19-class colours
Image.fromarray(palette[seg]).save("street_pred.png")
print(model.dataset_meta["classes"])

The config carries training/val dataloaders pointing at ./data/cityscapes/; those are unused for single-image inference. Class names and the colour palette are read from the checkpoint's retained meta["dataset_meta"].

Citing the original work

% Golden Cudgel Network, CVPR 2025 (arXiv:2503.03325)
@misc{yang2025goldencudgel,
  title         = {Golden Cudgel Network for Real-Time Semantic Segmentation},
  author        = {Guoyu Yang and Yuan Wang and Daming Shi and Yanzhong Wang},
  year          = {2025},
  eprint        = {2503.03325},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CV},
  url           = {https://arxiv.org/abs/2503.03325}
}

Provenance & license

  • Model weights © the original GCNet authors, released under MIT.
  • Trained on Cityscapes, which carries its own terms (academic / research use); the derived weights are redistributed on that same basis.
  • Mirrored by @dronefreak for convenient access. No affiliation with the original authors.
Downloads last month
20
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for dronefreak/gcnet-s-cityscapes

Evaluation results