ahmetozlu/face_recognition_crop

some issues

suifengtec opened this issue · 2 comments

  1. inconsistent use of tabs and spaces in indentation .
    File: \utils\create_csv.py Line: 38
  2. no parentheses after print for Python 3.x
    File: \utils\create_csv.py Line: 44

Use this code after def Create...

def CreateCsv(csvLine):
    BASE_PATH = csvLine
    SEPARATOR = ","

    label = 0
    with open("dataset.csv", "w") as file:
        writer = csv.writer(file)
        for dirname, dirnames, filenames in os.walk(BASE_PATH):
            for subdirname in dirnames:
                subject_path = os.path.join(dirname, subdirname)
                for filename in os.listdir(subject_path):
                    abs_path = "%s/%s" % (subject_path, filename)
                    csv_line = "%s%s%d" % (abs_path, SEPARATOR, label)
                    print(csv_line)
                    writer.writerows([csv_line.split(',')])
                label = label + 1

I apply this code in Pycharm Professional IDE.

Work great,thank you