xzz777 / SCTNet

Official implementation of SCTNet (AAAI2024)
MIT License
191 stars 12 forks source link

Predicting images #6

Closed djl00 closed 7 months ago

djl00 commented 10 months ago

How does the cityscapes test set predict images? It seems that no predictive code has been provided

djl00 commented 10 months ago

How are the parameter quantities calculated? I hope to receive your reply.

xzz777 commented 10 months ago

How does the cityscapes test set predict images? It seems that no predictive code has been provided

You can refer: 5.在 cityscapes 数据集上4卡 GPU 测试 PSPNet, 并生成 png 文件以便提交给官方评估服务器 https://github.com/open-mmlab/mmsegmentation/blob/v0.21.1/docs/zh_cn/inference.md 5.Test PSPNet on cityscapes test split with 4 GPUs, and generate the png files to be submit to the official evaluation server. https://github.com/open-mmlab/mmsegmentation/blob/v0.21.1/docs/en/inference.md In fact, we did not report the Cityscapes test accuracy in the paper. We do not recommend directly using the provided model for evaluating the Cityscapes test set, as this may yield lower results. Generally, models tested on the Cityscapes test set often involve training with additional data. For instance, PIDNet combines the training and validation sets, SFNet uses coarse annotations, InternImage employs extra data, and some methods utilize Mapillary pre-training. In practice, many methods apply specific training tricks on Cityscapes, such as Class Balanced Loss and Online Hard Example Mining (OHEM), before submitting to the official Cityscapes evaluation server. If you want to compare the results on the Cityscapes test set with other methods or modify SCTNet to achieve higher test set performance, it is advisable to retrain SCTNet with corresponding additional training data and incorporate the mentioned tricks.

xzz777 commented 10 months ago

How are the parameter quantities calculated? I hope to receive your reply.

python tools/get_flops.py configs/sctnet/cityscapes/sctnet-b_seg100_8x2_160k_cityscapes.py get_flops.py is a script provided by mmseg for measuring model parameters and FLOPs. If you have mmseg installed, you should be able to use it directly. If mmseg is not installed, you can refer to tools/test.py to add the working directory or move get_flops.py to the base directory before running it.

djl00 commented 10 months ago

参数量是如何计算的?我希望收到您的回复。

python tools/get_flops.py configs/sctnet/cityscapes/sctnet-b_seg100_8x2_160k_cityscapes.pyget_flops.py 是 mmseg 提供的用于测量模型参数和 FLOP 的脚本。如果你安装了 mmseg,你应该能够直接使用它。如果没有安装 mmseg,可以参考 tools/test.py 添加工作目录或get_flops.py移动到基目录后再运行。

I installed mmseg, why is it that when using this code to test the number of parameters, the values are much larger than those in the paper. python tools/get_flops.py configs/sctnet/cityscapes/sctnet-b_seg100_8x2_160k_cityscapes.py

xzz777 commented 10 months ago

参数量是如何计算的?我希望收到您的回复。

python tools/get_flops.py configs/sctnet/cityscapes/sctnet-b_seg100_8x2_160k_cityscapes.pyget_flops.py 是 mmseg 提供的用于测量模型参数和 FLOP 的脚本。如果你安装了 mmseg,你应该能够直接使用它。如果没有安装 mmseg,可以参考 tools/test.py 添加工作目录或get_flops.py移动到基目录后再运行。

I installed mmseg, why is it that when using this code to test the number of parameters, the values are much larger than those in the paper. python tools/get_flops.py configs/sctnet/cityscapes/sctnet-b_seg100_8x2_160k_cityscapes.py

那是因为你没有去掉config中模型定义的auxiliary_head部分。auxiliary_head只在训练过程中使用,但在mmseg架构下,在推理过程中也会构建,尽管并不需要,也不会参与推理,也不会影响精度。 如果你不去掉这部分,你测的参数量实际上是SCTNet+auxiliary_head0+auxiliary_head1(SegFormerB3)的参数量。 That's because you didn't remove the auxiliary_head part of the model definition in config. auxiliary_head is only used during training, but under the mmseg architecture, it is also built during inference, although it is not required, does not participate in inference, and does not affect accuracy. If you do not remove this part, the number of parameters you measure is actually the number of parameters for SCTNet+auxiliary_head0+auxiliary_head1 (SegFormerB3).

ly27253 commented 5 months ago

参数量是如何计算的?我希望收到您的回复。

python tools/get_flops.py configs/sctnet/cityscapes/sctnet-b_seg100_8x2_160k_cityscapes.pyget_flops.py 是 mmseg 提供的用于测量模型参数和 FLOP 的脚本。如果你安装了 mmseg,你应该能够直接使用它。如果没有安装 mmseg,可以参考 tools/test.py 添加工作目录或get_flops.py移动到基目录后再运行。

I installed mmseg, why is it that when using this code to test the number of parameters, the values are much larger than those in the paper. python tools/get_flops.py configs/sctnet/cityscapes/sctnet-b_seg100_8x2_160k_cityscapes.py

那是因为你没有去掉config中模型定义的auxiliary_head部分。auxiliary_head只在训练过程中使用,但在mmseg架构下,在推理过程中也会构建,尽管并不需要,也不会参与推理,也不会影响精度。 如果你不去掉这部分,你测的参数量实际上是SCTNet+auxiliary_head0+auxiliary_head1(SegFormerB3)的参数量。 That's because you didn't remove the auxiliary_head part of the model definition in config. auxiliary_head is only used during training, but under the mmseg architecture, it is also built during inference, although it is not required, does not participate in inference, and does not affect accuracy. If you do not remove this part, the number of parameters you measure is actually the number of parameters for SCTNet+auxiliary_head0+auxiliary_head1 (SegFormerB3).

那请问如何在配置文件中将auxiliary_head0+auxiliary_head1给屏蔽了?