precision-sustainable-ag / Field-AnnotationPipeline

This repo automates semantic labels and bounding boxes for Field imagery, within the broader Ag Image Repository, focusing on real-world agricultural conditions essential for training deep learning models.
MIT License
0 stars 0 forks source link

create metadata file for empty detection results #23

Closed mkutu closed 1 week ago

mkutu commented 3 weeks ago

detect_weeds.py is not creating a metadata file no detections. Regardless if the image has or does not have detection results, the metadata file should still be there.

navjot-nangia commented 3 weeks ago

@mkutu What should be included in this metadata file? I have attached an example of metadata for detection. ALA00138.json

mkutu commented 2 weeks ago

use this file as a reference. What I changed:

  1. renamed "exif_meta" to "exif_info"

  2. reorganized image_info

  3. added plant_field_info

  4. turned category into a single dictionary

  5. removed username

  6. removed "MasterRefID"

  7. removed basename

  8. renamed detection_results to annotation

  9. made annotation a dictionary

  10. removed image_id from annotation dictionary

  11. removed class_id from annotation dictionary

  12. Exif_info should contain these keys only: ImageWidth ImageLength Make Model Software DateTime ExposureTime FNumber ExposureProgram ISOSpeedRatings RecommendedExposureIndex ExifVersion BrightnessValue MaxApertureValue LightSource Flash FocalLength ExposureMode WhiteBalance FocalLengthIn35mmFilm Contrast Saturation Sharpness LensModel LensSpecification BodySerialNumber

  13. renamed bbox to bbox_xywh (bbox coordinates need to be changed accordingly). This should be a list of values xywh

ALA00138_updated.json

mkutu commented 2 weeks ago

@navjot-nangia I only change the file itself. I haven't changed anything.

navjot-nangia commented 2 weeks ago

DONE

mkutu commented 2 weeks ago

@navjot-nangia keep "category" even if there are not detection results

make bbox_xywh as null if there is not detection result.

"annotation": {
    "bbox_xywh": null
}
mkutu commented 2 weeks ago

use this dataclass to format the metadata, and this method to extract it

mkutu commented 2 weeks ago

make the internal "bbox" variable in segment.py "_bbox" and write a comment or 2 to document the fact that it's internal use only

navjot-nangia commented 2 weeks ago

After using the method, these three parameters have issue:

Other parameters are good.

The exif data from one of the images: exif_data.txt

mkutu commented 2 weeks ago

@navjot-nangia yea you can just rename them. I think bodyserial number only is exposed in some camera for some reason. Looks good

navjot-nangia commented 2 weeks ago

DONE