I use pandas.read_csv(r'absolute directory',encoding='utf-8',names=[])
to read a .txt file. It is about 11MB, the data was read out,but got an confused error
data format:
123016
img/img_00000001.jpg 1 1 1 144 156 1 221 159 0 086 218 1 250 238 0 111 408 0 237 412
img/img_00000002.jpg 1 3 0 111 104 1 153 105 0 074 146 0 181 163 1 084 188 1 137 198
img/img_00000003.jpg 1 1 0 112 113 1 172 117 0 069 170 0 210 174 1 101 277 1 187 262
img/img_00000004.jpg 1 2 0 076 074 0 108 069 0 045 114 0 142 100 0 066 174 0 126 170
running code:
import io
import os
import sys
import numpy as np
from PIL import Image
import tensorflow as tf
import cv2
import json
from scipy import misc
from io import BytesIO
import pandas as pd
slim = tf.contrib.slim
data = pd.read_csv(r'D:\DeepFashion\Fashion Landmark Detection Benchmark\Anno\list_landmarks.txt', sep='\s+',
encoding = "utf-8",error_bad_lines=False,
names=['image_name','clothes_type','variation_type',
'landmark_visibility_1','landmark_location_x_1','landmark_location_y_1',
'landmark_visibility_2','landmark_location_x_2', 'landmark_location_y_2',
'landmark_visibility_3','landmark_location_x_3', 'landmark_location_y_3',
'landmark_visibility_4','landmark_location_x_4', 'landmark_location_y_4',
'landmark_visibility_5','landmark_location_x_5', 'landmark_location_y_5',
'landmark_visibility_6','landmark_location_x_6', 'landmark_location_y_6',
'landmark_visibility_7','landmark_location_x_7', 'landmark_location_y_7',
'landmark_visibility_8','landmark_location_x_8', 'landmark_location_y_8'])
User contributions licensed under CC BY-SA 3.0