簡體   English   中英

keras flow_from_dataframe 用於圖像分割(即使用二進制掩碼作為標簽)

[英]keras flow_from_dataframe for image segmentation (i.e. with a binary mask as label)

有沒有辦法使用來自keras( https://keras.io/api/preprocessing/image/#flowfromdataframe-method )的方法“flow_from_dataframe”來加載帶有掩碼的圖像? 這樣,y 不是一個類別,而是一個路徑,以便二進制掩碼與圖像一起加載。

加載數據的示例數據框是:

+---+---------------------+---------+-------------------------+
|   | img_path            | subject | mask_path               |
+---+---------------------+---------+-------------------------+
| 0 | images/DSC_4540.TIF | 4540    | masks/DSC_4540_mask.tif |
+---+---------------------+---------+-------------------------+
| 1 | images/DSC_9228.TIF | 9228    | masks/DSC_9228_mask.tif |
+---+---------------------+---------+-------------------------+
| 2 | images/DSC_6674.TIF | 6674    | masks/DSC_6674_mask.tif |
+---+---------------------+---------+-------------------------+
| 3 | images/DSC_3453.TIF | 3453    | masks/DSC_3453_mask.tif |
+---+---------------------+---------+-------------------------+
| 4 | images/DSC_6808.TIF | 6808    | masks/DSC_6808_mask.tif |
+---+---------------------+---------+-------------------------+
| 5 | images/DSC_5494.TIF | 5494    | masks/DSC_5494_mask.tif |
+---+---------------------+---------+-------------------------+

您可以為掩碼創建一個單獨的 ImageDataGenerator,然后使用現有的 ImageDataGenerator 將其壓縮。

查看文檔中的第三個示例。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM