Initialization. Args: image_id: (optional) Identifier for the image. question_ids: (optional) List of unique identifiers for the questions. questions: (optional) List of question strings. answers: (optional) List of answer strings. captions: (optional) List of capt
(
self,
image_id=-1,
question_ids=None,
questions=None,
answers=None,
captions=None,
objects=None,
)
| 42 | return length |
| 43 | |
| 44 | def __init__( |
| 45 | self, |
| 46 | image_id=-1, |
| 47 | question_ids=None, |
| 48 | questions=None, |
| 49 | answers=None, |
| 50 | captions=None, |
| 51 | objects=None, |
| 52 | ): |
| 53 | """Initialization. |
| 54 | |
| 55 | Args: |
| 56 | image_id: (optional) Identifier for the image. |
| 57 | question_ids: (optional) List of unique identifiers for the questions. |
| 58 | questions: (optional) List of question strings. |
| 59 | answers: (optional) List of answer strings. |
| 60 | captions: (optional) List of caption strings. |
| 61 | objects: (optional) Filename of HDF5 file with R-CNN data. Could also be |
| 62 | an open filehandle. |
| 63 | """ |
| 64 | self.image_id = image_id |
| 65 | length = self._get_length(question_ids, questions, answers, captions) |
| 66 | self.question_ids = question_ids or [-1] * length |
| 67 | self.questions = questions or ["_"] * length |
| 68 | self.answers = answers or ["_"] * length |
| 69 | self.captions = captions or ["_"] * length |
| 70 | self.objects = objects |
| 71 | |
| 72 | |
| 73 | def quantize_bbox(bboxes, height, width, grid_size=GRID_SIZE): |
nothing calls this directly
no test coverage detected