Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confused about how to use? your guide is too simple #6

Open
nTnZone opened this issue Apr 20, 2021 · 0 comments
Open

confused about how to use? your guide is too simple #6

nTnZone opened this issue Apr 20, 2021 · 0 comments

Comments

@nTnZone
Copy link

nTnZone commented Apr 20, 2021

first I write this according to your guide:
xml_list_path = os.path.join(sys.path[1],"dataset/label/annotation2021")
convert("xmllist.txt", xml_list_path, "output.json")
and raise a error:FileNotFoundError: [Errno 2] No such file or directory
my xmllist contains all the xml file such as 000001.xml 000002.xml... and each line contains one filename

Second I want to understand your code for fix this error
def convert(xml_list, xml_dir, json_file):
list_fp = open(xml_list, 'r')
json_dict = {"images":[], "type": "instances", "annotations": [],
"categories": []}
categories = PRE_DEFINE_CATEGORIES
bnd_id = START_BOUNDING_BOX_ID
for line in list_fp:
line = line.strip()
print("line:"+line)
print("Processing %s"%(line))
xml_f = os.path.join(xml_dir, line)
print("xml_f:"+xml_f)
tree = ET.parse(xml_f)
root = tree.getroot()
print(type(root))
path = get(root, 'path')
.......
what this 'path' mean? And this script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant