missing txt file s3d_cat2num.txt
how can I get this text file ?
Can you give me an example if I have to make it myself?
Hi, actually you can generate this file yourself quite easily, after you downloaded the S3DIS dataset, you iterate the folder names (i.e. categories) under Area 1 - 6 and create a dict mapping each category to an integer. There should be around 40 categories if I recall correctly.
Hi, actually you can generate this file yourself quite easily, after you downloaded the S3DIS dataset, you iterate the folder names (i.e. categories) under Area 1 - 6 and create a
dictmapping each category to an integer. There should be around 40 categories if I recall correctly.
Hi, @kentsyx ,can you show more details about how to genarate this text file,I still can't get it,thx!
@shadowoflight1 I agree too.. @kentsyx I'm not sure yet, can you explain it in more detail? Or can you share the file you created?
I wrote a gen_s3d_cat2num.py as follows that solves the problem. Don't feel like to PR so if @kentsyx you like you could add that to your project.
import os
def main():
cats = set()
data_root = "Stanford3dDataset_v1.2_Aligned_Version"
for _set in ["train", "test"]:
area_list = os.listdir(os.path.join(data_root, _set))
for _area in area_list:
category_list = os.listdir(os.path.join(data_root, _set, _area))
for category in category_list:
if category.split('_')[0] == ".DS":
continue
for cat in os.listdir(os.path.join(data_root, _set, _area, category, "Annotations")):
cats.add(cat.split('_')[0])
cats.remove(".DS")
# print(cats)
f = open(data_root + "/s3d_cat2num.txt", "w+")
for i, cat in enumerate(cats):
f.write("%s %d\n" % (cat, i))
f.close()
if __name__ == "__main__":
main()