0

I have a file that has annotation for a image for object detection. I wanted to change this into a COCO format so that I can retrain a yolo model for this, but I dont know how to change this format or if this is another model format. It is saved in a Json format which makes me think of COCO but I am not sure. Any help with this will be appreciated.

This is the file:

{"review_status":"pass","annotated_data":[{"data":[],"label":"Truck","bounding_box_data":[{"x":546,"y":245,"width":63,"height":93},{"x":606,"y":213,"width":48,"height":71}]},{"data":[],"label":"Pedestrian","bounding_box_data":[{"x":486,"y":305,"width":19,"height":48}]},{"data":[],"label":"Bus","bounding_box_data":[{"x":889,"y":226,"width":39,"height":53}]}],"annotation_status":"done"}
MNM
  • 2,673
  • 6
  • 38
  • 73
  • 1
    COCO data format is look like this http://cocodataset.org/#format-data, so I suggest you to create your own program to extract the information from your dataset to create new COCO JSON data format. how to build COCO dataset format : http://www.immersivelimit.com/tutorials/create-coco-annotations-from-scratch/#coco-dataset-format , https://patrickwasp.com/create-your-own-coco-style-dataset/ – gameon67 Mar 12 '19 at 00:06
  • I see, I created a parser now to get the label and the bbox and will see how to set up the CoCo data set. Would you have any options for yolo training? I have been trying to follow the process on some tutorials but still dont get how to make them – MNM Mar 12 '19 at 06:58
  • You mean training your own custom dataset? Not using COCO? – gameon67 Mar 12 '19 at 07:22
  • That is where some of the confusion is coming from. I want to add in new images of cars, trucks, vans, motorcycles, and people to yolo. These are already in there but I need something for night time scenes and I have a specific camera for it too. Right now the out of the box yolov3 does not do a good job. – MNM Mar 12 '19 at 23:05
  • Should I use these as new classes even though there is a car and truck ect already in yolo? – MNM Mar 12 '19 at 23:06
  • 1
    Look here, they have similar confusion https://groups.google.com/forum/?nomobile=true#!topic/darknet/xR3bziqAvJc , and 1 person suggest to use this https://github.com/holger-prause/yolo_utils to create dataset based on coco classes, then you can combine with your own data. Can you give it a try and tell me whether it works or not? – gameon67 Mar 13 '19 at 00:08
  • 1
    also refer to this https://stackoverflow.com/questions/51100191/how-can-i-download-a-specific-part-of-coco-dataset – gameon67 Mar 13 '19 at 00:11
  • Sweet I will look over it today. This is a bit confusing and I appreciate it – MNM Mar 13 '19 at 01:49
  • 1
    Thank you gameon67 I read those post and figured out a way to do it as the github link had the method for finding the values I needed. – MNM Mar 14 '19 at 01:07

1 Answers1

1

Ok thanks to @gameon67 I worked though the issue. What I had to do is to 1 parse the json file out

2 get the x, y, w, h data from the file

translate that to something yolo neede.

Take the centro id point of the x y by using geometry.

Then making a text file like this

object-class x y width height

I based a lot of this on here https://medium.com/@manivannan_data/how-to-train-yolov2-to-detect-custom-objects-9010df784f36

MNM
  • 2,673
  • 6
  • 38
  • 73