Skip to content

Changes needed to Converting *.xml to *.csv #2

@jatansharma

Description

@jatansharma

Following changes I had to make in "generate_tfrecord.py" file to make it work with the given cmd command:

  1. Define flag for image path which is passed through command line
    flags.DEFINE_string('img_path', '', 'Path to the images')

  2. Inside create_tf_example definition change path to FLAGS.img_path
    with tf.gfile.GFile(os.path.join(FLAGS.img_path, '{}'.format(group.filename)), 'rb') as fid:

Also, I got Nonetype error: None has type NoneType, but expected one of: int, long. To fix this change the else return to 0 instead of null
`
def class_text_to_int(row_label):

if row_label == FLAGS.label:  # 'ship':

    return 1

else:

    return 0

`

PS: let me know if there is a better solution
PPS: Still waiting on label map implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions