widerface-to-tfrecord icon indicating copy to clipboard operation
widerface-to-tfrecord copied to clipboard

Error while running: raise Exception.

Open paarthbir77 opened this issue 5 years ago • 3 comments

Hi, I tried to create tfrecords by following along but got stuck in an error somewhere, Here's my directory: widerface-to-tfrecord-master -utils -wider_face_split --wider_face_split ---.txt and .mat s -WIDER_train --WIDER_train ---images -WIDER_val --WIDER_val ---images -WIDER_test --WIDER_test ---images -output -config.py -wider_to_tfrecord.py

I've set config.py as:

TRAIN_WIDER_PATH = "./WIDER_train/WIDER_train/"

VAL_WIDER_PATH = "./WIDER_val/WIDER_val/"

TEST_WIDER_PATH = None

GROUND_TRUTH_PATH = "./wider_face_split/wider_face_split/"

OUTPUT_PATH = "./output/"

and on running wider_to_tfrecord.py : python3 wider_to_tfrecord.py Processing WIDER_train/WIDER_train/images Traceback (most recent call last): File "wider_to_tfrecord.py", line 170, in tf.app.run() File "/home/paarth/.local/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "wider_to_tfrecord.py", line 152, in main run(images_path, description_file, output_path) File "wider_to_tfrecord.py", line 131, in run tf_example = parse_example(f, images_path) File "wider_to_tfrecord.py", line 76, in parse_example raise Exception() Exception

paarthbir77 avatar Jun 16 '19 17:06 paarthbir77

@paarthbir77 Hi! Some images in wider face dataset include no bounding box, which causes this exception. You can print the filenames to see where it stuck.

Queequeg92 avatar Jul 01 '19 10:07 Queequeg92

@paarthbir77 check the paths, especially if you're trying to process on Windows.

dozeBoy avatar Oct 12 '19 10:10 dozeBoy

At line 75 replace code as such:

    if not isinstance(face_num, int):
        print('[ERROR] not an integer', face_num)
        raise Exception()
    elif face_num==0:
        '''if no faces are given the co-rdinates are specified as 0 in annotations'''
        face_num = 1`

deepwilson avatar Sep 04 '20 08:09 deepwilson