博客
关于我
concurrent.futures dataset
阅读量:89 次
发布时间:2019-02-26

本文共 1322 字,大约阅读时间需要 4 分钟。

通过测试发现并未发现比多线程块更高效的方式来处理图片数据

以下是所需的主要库和模块:

import datetime

import os

import threading

from concurrent.futures import ThreadPoolExecutor

import numpy as np

import logging

import cv2

import torch

from torch.utils.data import Dataset

import xml.etree.ElementTree as ET

from common import data_transforms

CLASSES = ('mouse',)

def aaa(listDataset): for index in range(len(listDataset.img_files)): if index in listDataset.img_d: pass else: img_path = listDataset.img_files[index % len(listDataset.img_files)].rstrip() img = cv2.imread(img_path, cv2.IMREAD_COLOR) if img is None: raise Exception("读取图片错误:{}".format(img_path)) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) h, w, c = img.shape label_path =

注意:上述优化后的代码主要进行了以下调整:

  • 删除了不必要的空格和格式化符号
  • 保持了代码的基本逻辑和功能
  • 使用了更简洁的语言表达
  • 保持了代码的可读性和可维护性
  • 保持了与搜索引擎友好的结构
  • 如果需要进一步优化或补充具体功能,请提供更多细节。

    转载地址:http://tsfk.baihongyu.com/

    你可能感兴趣的文章
    presentModalViewController显示半透明的一个view
    查看>>
    PresentViewController切换界面
    查看>>
    PyTorch之torch.utils.data.DataLoader解读
    查看>>
    PyTorch之DataLoader杂谈
    查看>>
    presto、druid、sparkSQL、kylin的对比分析
    查看>>
    Presto分布式大数据查询引擎
    查看>>
    Presto架构及原理
    查看>>
    Presto(一)集群部署
    查看>>
    Presto(二)开启安全认证
    查看>>
    Pricing procedure Steps and Details in SAP MM (from SCN)
    查看>>
    Prim 算法在不同权重范围内的性能分析及其实现
    查看>>
    Primace 5.0软件与KEIL单片机软件联合在线仿真步骤
    查看>>
    Prime Distance
    查看>>
    Prim求MST最小生成树
    查看>>
    Prim算法与Kruskal算法在均匀分布权重图中的性能比较
    查看>>
    Prim算法在加权连通图中的简单实现
    查看>>
    Prim算法详解及C代码示例
    查看>>
    pytorch中让数组显示更多的数字 torch.set_printoptions参数详解 numpy也是这个函数
    查看>>
    pringBoot Controller接收参数的几种常用方式
    查看>>
    printf()函数
    查看>>