经过测试,没有发现比多线程块
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 E