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

  • 大小: 2.06MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-09-14
  • 語(yǔ)言: 其他
  • 標(biāo)簽:

資源簡(jiǎn)介

圖像語(yǔ)義分割 FCN方法,使用tensorflow庫(kù),解壓使用即可

資源截圖

代碼片段和文件信息

#?coding=utf-8
“““
Code?ideas?from?https://github.com/Newmu/dcgan?and?tensorflow?mnist?dataset?reader
“““
import?numpy?as?np
import?scipy.misc?as?misc


class?BatchDatset:
????files?=?[]
????images?=?[]
????annotations?=?[]
????image_options?=?{}
????batch_offset?=?0
????epochs_completed?=?0

????def?__init__(self?records_list?image_options={}):
????????“““
????????Intialize?a?generic?file?reader?with?batching?for?list?of?files
????????:param?records_list:?list?of?file?records?to?read?-
????????sample?record:?{‘image‘:?f?‘a(chǎn)nnotation‘:?annotation_file?‘filename‘:?filename}
????????:param?image_options:?A?dictionary?of?options?for?modifying?the?output?image
????????Available?options:
????????resize?=?True/?False
????????resize_size?=?#size?of?output?image?-?does?bilinear?resize
????????color=True/False
????????“““
????????print(“Initializing?Batch?Dataset?Reader...“)
????????print(image_options)
????????self.files?=?records_list???????#?文件列表
????????self.image_options?=?image_options??#?圖片操作方式?resize??224
????????self._read_images()

????def?_read_images(self):
????????self.__channels?=?True
????????#?掃描files字典中所有image?圖片全路徑
????????#?根據(jù)文件全路徑讀取圖像,并將其擴(kuò)充為RGB格式
????????self.images?=?np.array([self._transform(filename[‘image‘])?for?filename?in?self.files])
????????self.__channels?=?False

????????#?掃描files字典中所有annotation?圖片全路徑
????????#?根據(jù)文件全路徑讀取圖像,并將其擴(kuò)充為三通道格式
????????self.annotations?=?np.array(
????????????[np.expand_dims(self._transform(filename[‘a(chǎn)nnotation‘])?axis=3)?for?filename?in?self.files])
????????print?(self.images.shape)
????????print?(self.annotations.shape)

????def?_transform(self?filename):
????????#?讀取文件圖片
????????image?=?misc.imread(filename)
????????if?self.__channels?and?len(image.shape)?????????????#?將圖片三個(gè)通道設(shè)置為一樣的圖片
????????????image?=?np.array([image?for?i?in?range(3)])

????????if?self.image_options.get(“resize“?False)?and?self.image_options[“resize“]:

????????????resize_size?=?int(self.image_options[“resize_size“])
????????????#?使用最近鄰插值法resize圖片
????????????resize_image?=?misc.imresize(image
?????????????????????????????????????????[resize_size?resize_size]?interp=‘nearest‘)
????????else:
????????????resize_image?=?image

????????return?np.array(resize_image)???????#?返回已經(jīng)resize的圖片

????def?get_records(self):
????????“““
????????返回圖片和標(biāo)簽全路徑
????????:return:
????????“““
????????return?self.images?self.annotations

????def?reset_batch_offset(self?offset=0):
????????“““
????????剩下的batch
????????:param?offset:
????????:return:
????????“““
????????self.batch_offset?=?offset

????def?next_batch(self?batch_size):
????????#?當(dāng)前第幾個(gè)batch
????????start?=?self.batch_offset
????????#?讀取下一個(gè)batch??所有offset偏移量+batch_size
????????self.batch_offset?+=?batch_size
????????#?iamges存儲(chǔ)所有圖片信息?images.shape(len?h?w)
????????if?self.batch_offset?>?self.images.shape[0]:??????#?如果下一個(gè)batch的偏移量超過(guò)了圖片總數(shù)?說(shuō)明完成了一個(gè)epoch
????????????#?Finished?epoch
????????????self.epochs_completed?+=?1??????#?epochs完成總數(shù)+1
?

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-04-24?12:22??FCN-TensorFlow-master\
?????文件????????4475??2018-04-24?12:22??FCN-TensorFlow-master\BatchDatsetReader.py
?????文件????????4146??2018-04-24?12:22??FCN-TensorFlow-master\BatchDatsetReader.pyc
?????文件???????14126??2018-04-24?12:22??FCN-TensorFlow-master\FCN.py
?????文件????????1074??2018-04-24?12:22??FCN-TensorFlow-master\LICENSE
?????文件????????4887??2018-04-24?12:22??FCN-TensorFlow-master\README.md
?????文件????????9700??2018-04-24?12:22??FCN-TensorFlow-master\TensorflowUtils.py
?????文件???????12341??2018-04-24?12:22??FCN-TensorFlow-master\TensorflowUtils.pyc
?????目錄???????????0??2018-04-24?12:22??FCN-TensorFlow-master\images\
?????文件??????113332??2018-04-24?12:22??FCN-TensorFlow-master\images\Image_Cmaped.ipynb
?????文件???????20876??2018-04-24?12:22??FCN-TensorFlow-master\images\conv_1_1_gradient.png
?????文件???????16359??2018-04-24?12:22??FCN-TensorFlow-master\images\conv_4_1_gradient.png
?????文件???????16447??2018-04-24?12:22??FCN-TensorFlow-master\images\conv_4_2_gradient.png
?????文件???????16355??2018-04-24?12:22??FCN-TensorFlow-master\images\conv_4_3_gradient.png
?????文件????????1928??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_0.png
?????文件????????2214??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_1.png
?????文件????????3875??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_2.png
?????文件????????3628??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_3.png
?????文件????????3490??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_4.png
?????文件????????1439??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_5.png
?????文件????????3062??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_6.png
?????文件????????4309??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_7.png
?????文件????????3027??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_8.png
?????文件????????9716??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_c0.png
?????文件???????10398??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_c1.png
?????文件???????15633??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_c2.png
?????文件???????13852??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_c3.png
?????文件???????14244??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_c4.png
?????文件????????8791??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_c5.png
?????文件???????12713??2018-04-24?12:22??FCN-TensorFlow-master\images\gt_c6.png
?????文件???????81929??2018-04-24?12:22??FCN-TensorFlow-master\images\inp_0.png
............此處省略78個(gè)文件信息

評(píng)論

共有 條評(píng)論