91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

修改了cityscapesscripts/evaluation/vevalPixelLevelSemanticLabeling.py文件,可以實現(xiàn)利用符合trainId的圖像評估神經(jīng)網(wǎng)絡(luò)的IoU;另外可以評估更改了分辨率的預(yù)測圖像。

資源截圖

代碼片段和文件信息

#!/usr/bin/python
#
#by?yly?20180820
#?This?is?a?modified?version?of?evalPixelLevelSemanticLabeling.py?which?use?trainID?to?eval?IoU;
#?1.?Change?the?dir?of?groundTruth?file?and?predition?file?according?to?you?dir
#?2.?GroudTruthImg?can?be?resized?to?match?your?prediction?images?if?the?resolution?of?your?prediction?images?are?not?2048x1024?please?change?the?parameter?of?resize?in?the?following?text?
#?3.?Put?this?scrip?under?cityscripts/evaluation?which?can?be?downloaded?from?https://github.com/mcordts/cityscapesscripts
#The?3?channel?png?of?the?prediction?results?is?converted?single?channel
#?The?evaluation?script?for?pixel-level?semantic?labeling.
#?We?use?this?script?to?evaluate?your?approach?on?the?test?set.
#?You?can?use?the?script?to?evaluate?on?the?validation?set.
#
#?Please?check?the?description?of?the?“getPrediction“?method?below
#?and?set?the?required?environment?variables?as?needed?such?that
#?this?script?can?locate?your?results.
#?If?the?default?implementation?of?the?method?works?then?it‘s?most?likely
#?that?our?evaluation?server?will?be?able?to?process?your?results?as?well.
#
#?Note?that?the?script?is?a?lot?faster?if?you?enable?cython?support.
#?WARNING:?Cython?only?tested?for?Ubuntu?64bit?OS.
#?To?enable?cython?run
#?setup.py?build_ext?--inplace
#
#?To?run?this?script?make?sure?that?your?results?are?images
#?where?pixels?encode?the?class?IDs?as?defined?in?labels.py.
#?Note?that?the?regular?ID?is?used?not?the?train?ID.
#?Further?note?that?many?classes?are?ignored?from?evaluation.
#?Thus?authors?are?not?expected?to?predict?these?classes?and?all
#?pixels?with?a?ground?truth?label?that?is?ignored?are?ignored?in
#?evaluation.

#?python?imports
from?__future__?import?print_function
import?os?sys
import?platform
import?fnmatch

try:
????from?itertools?import?izip
except?ImportError:
????izip?=?zip

#?Cityscapes?imports
sys.path.append(?os.path.normpath(?os.path.join(?os.path.dirname(?__file__?)??‘..‘??‘helpers‘?)?)?)
from?csHelpers?import?*

#?C?Support
#?Enable?the?cython?support?for?faster?evaluation
#?Only?tested?for?Ubuntu?64bit?OS
CSUPPORT?=?True
#?Check?if?C-Support?is?available?for?better?performance
if?CSUPPORT:
????try:
????????import?addToConfusionMatrix
????????print(‘dd‘)
????except:
????????CSUPPORT?=?False


###################################
#?PLEASE?READ?THESE?INSTRUCTIONS!!!
###################################
#?Provide?the?prediction?file?for?the?given?ground?truth?file.
#
#?The?current?implementation?expects?the?results?to?be?in?a?certain?root?folder.
#?This?folder?is?one?of?the?following?with?decreasing?priority:
#???-?environment?variable?CITYSCAPES_RESULTS
#???-?environment?variable?CITYSCAPES_DATASET/results
#???-?../../results/“
#
#?Within?the?root?folder?a?matching?prediction?file?is?recursively?searched.
#?A?file?matches?if?the?filename?follows?the?pattern
#?_123456_123456*.png
#?for?a?ground?truth?filename
#?_123456_123456_gtFine_labelIds.png
def?getPrediction(?args?groundTruthFile?):

評論

共有 條評論