I have to write some complex data to a file that can be easily iterable later on. I have a list of images and for each image I have a list of objects with coordinates for each one of it.
This is my current data format, a list:
[[[x_coord, y_coord], [widh, height], rotation],["object_name", accuracy]],
[[...]] ....]
What I want is to have all that attached to an image name. So, when I want to iterate each image, i want to be able to read all the above data for each image.
To better understand the problem, I have a system that takes as input an image and outputs a list as the one above. Instead of the variabile names I have values. Now, I want to run more than 1 image with my system but I don't know how to store the output so that I would know to which image the output corresponds to because I want to share the results. This is an example of what my system outputs from an image.
[[[[711.2923254686244, 509.8931226169361], [152.17577602646008, 18.75684392334363], 0.8387087394488912], ["H", 0.9245172388413373, 0]], [[[707.8748537512387, 415.88163813422705], [142.3154146012468, 18.638623686112567], 0.9886537282165556], ["Negative", 0.9904577591839958, 0]], [[[272.4707519306856, 655.1721772586598], [186.6175797860084, 19.211811300659143], 0.22486986712600301], ["plasmid", 0.941743278503418, 0]], [[[124.15456456296585, 250.43897797079646], [29.55055251880988, 15.06842795688405], -9.258418081903768], ["11", 0.9978194236755371, 0]], [[[94.68372611438528, 251.45963820289163], [35.19040782622253, 26.019563655695396], -6.836103324206618], ["C", 0.9792481660842896, 0]], [[[521.6560694750618, 654.7176179324879], [101.80468126671622, 18.683637160515204], 0.3779982099082056], ["RM", 0.970346314566476, 0]], [[[650.0936701718499, 512.4483476526597], [28.275388840998474, 16.91495785856379], 0.715133060422265], ["9", 0.28899475932121277, 0]], [[[681.2160289988799, 416.6489298203412], [63.57085096105481, 15.692085586024415], 2.5319410047875994], ["Empty cell", 0.9971669316291809, 0]], [[[280.7394181980806, 203.18943001242243], [38.38290734128221, 35.22847492151178], 0.6360230675017051], ["L", 0.9367004632949829, 0]], [[[681.4627260320327, 508.57304371104516], [62.768154091603066, 15.44289448080739], -0.5180496117273432], ["test", 0.908484935760498, 0]], [[[727.4159714754891, 415.9454027063706], [66.49714216688848, 15.303173897880407], -0.8295930881855053], ["positive", 0.9496070688421075, 0]]]
Is there a way to have a list of images and for each image to have another list like the one above?
Or what would be the right way to store this if list of list isn't the right way to do it?
I usually code in C and the concept of lists and dictionaries are pretty new to me and I don't quite understand how they fully work, therefore I don't understand when to use them.