class_docstr: Writes object detection dataset into tfrecords.
  
  Reads dataset from a subclass of ObjectDetectionReader and saves it using
  the default format for tfrecords.
class_docstr_tok: ["Writes","object","detection","dataset","into","tfrecords",".","Reads","dataset","from","a","subclass","of","ObjectDetectionReader","and","saves","it","using","the","default","format","for","tfrecords","."]
docstr: Checks that the record is valid before saving it.
  
  Args:
      record: `dict`
  
  Raises:
      InvalidRecord when required keys are missing from the record.
docstr_tok: ["Checks","that","the","record","is","valid","before","saving","it",".","Args",":","record",":","`","dict","`","Raises",":","InvalidRecord","when","required","keys","are","missing","from","the","record","."]
code: def _validate_record(self, record):
      """
      Checks that the record is valid before saving it.
  
      Args:
          record: `dict`
  
      Raises:
          InvalidRecord when required keys are missing from the record.
      """
      record_keys = set(record.keys())
      if record_keys != REQUIRED_KEYS:
          raise InvalidRecord(
              "Missing keys: {}".format(REQUIRED_KEYS - record_keys)
          )
  
      if len(record["gt_boxes"]) == 0:
          raise InvalidRecord(
              "Record should have at least one `gt_boxes`"
          )
  
      for gt_box in record["gt_boxes"]:
          gt_keys = set(gt_box.keys())
          if gt_keys != REQUIRED_GT_KEYS:
              raise InvalidRecord(
                  "Missing gt boxes keys {}".format(
                      REQUIRED_GT_KEYS - gt_keys
                  )
              )
  
file_path: luminoth/luminoth/tools/dataset/writers/object_detection_writer.py
imports: import click
  import json
  import os
  import tensorflow
  from .base_writer import BaseWriter
  from luminoth.tools.dataset.readers import ObjectDetectionReader
  from luminoth.utils.dataset import to_int64, to_string, to_bytes
label_desc: Use image node_id 3 for calling the ObjectDetectionWriter obj's underlying member method code with example usage: obj._validate_record(record) without return types