This is a Pytorch implementation of Stratified K-Fold for Segmentation task. The dataset follows COCO format.
You can consider the following three conditions:
- Number of categories for each image
- Number of category types for each image
- Number of annotations in each image
Categories can be grouped into lists and customized by referring to visualization and standard deviation for categories using save_data.ipynb as follows.
# type_list : Category types grouping
# num_list : Number of annotations grouping
# split_num : Fold number
type_list = [[1], [2, 3, 4], [5, 6], [7, 8]]
num_list = [23, 35]
split_num = 5