开发者社区> 问答> 正文

数据预处理的代码是什么啊?

已解决

数据预处理的代码是什么啊?

展开
收起
OPPOLC 2022-07-27 13:33:36 592 0
1 条回答
写回答
取消 提交回答
  • 推荐回答
    p=0 
    tf = []
    for files in os.walk('data/inage', topdown=False):
    f= files
    for item in tqdm(f[2]);
    label = cv2.imread(data/label/0’ format(item), cv2 IMREAD GRAYSCALE)
    index0=0 
    index1=0 
    index2=0 
    index3=0
    [rows, cols] = 1abel.shape
    # print(rows, cols) 
    for i in range(rows):
    for j in range(cols);
    if (label[i, j] == 0):
    index0 = index0 +1 
    elif (label[i, j] == 1):
    index1 =index1 +1 
    elif (label[i, j] == 2):
    index2=index2 +1 
    else:
    index3=index3+1
    ImageSize#512*512
    if (index0 / ImageSize < percentage and indexl/ ImageSize <percentage and\
    index2 / ImageSize < percentage and index3/ImageSize<percentage):
     p=p+1
    tf. append(item)
    
    2022-07-27 15:01:12
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
机器学习中,使用Scikit-Leam简单处理文本数据 立即下载
纯干货|机器学习中梯度下降法的分类及对比分析 立即下载
纯干货 | 机器学习中梯度下降法的分类及对比分析 立即下载