擅长:python、mysql、java
<p>我认为可以使用ID标签迭代csv文件来读取图像。
例如:</p>
<pre><code>import csv
csv_path = 'your_csv_path'
images_base_path = 'your_images_path'
images=[]
labels=[]
with open(csv_path, newline='',encoding="utf8") as csvfile:
spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
for row in spamreader:
# And than you can do like this:
# images_complete_path = images_base_path + row[0]
# images.append(imread(images_complete_path))
# labels.append(row[1])
</code></pre>
<p>然后,您可以获得图像和标签。
这只是一个想法,你可以很容易地实现它。
希望能有所帮助</p>