代码拉取完成,页面将自动刷新
#!/bin/bash
# Image and model names
TEST_IMG=ADE_val_00001519.jpg
MODEL_NAME=ade20k-resnet50dilated-ppm_deepsup
MODEL_PATH=ckpt/$MODEL_NAME
RESULT_PATH=./
ENCODER=$MODEL_NAME/encoder_epoch_20.pth
DECODER=$MODEL_NAME/decoder_epoch_20.pth
# Download model weights and image
if [ ! -e $MODEL_PATH ]; then
mkdir -p $MODEL_PATH
fi
if [ ! -e $ENCODER ]; then
wget -P $MODEL_PATH http://sceneparsing.csail.mit.edu/model/pytorch/$ENCODER
fi
if [ ! -e $DECODER ]; then
wget -P $MODEL_PATH http://sceneparsing.csail.mit.edu/model/pytorch/$DECODER
fi
if [ ! -e $TEST_IMG ]; then
wget -P $RESULT_PATH http://sceneparsing.csail.mit.edu/data/ADEChallengeData2016/images/validation/$TEST_IMG
fi
if [ -z "$DOWNLOAD_ONLY" ]
then
# Inference
python3 -u test.py \
--imgs $TEST_IMG \
--cfg config/ade20k-resnet50dilated-ppm_deepsup.yaml \
DIR $MODEL_PATH \
TEST.result ./ \
TEST.checkpoint epoch_20.pth
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。