diff --git a/composer.json b/composer.json index 03592bc..e085458 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,10 @@ { "name": "Martin Zurowietz", "email": "m.zurowietz@uni-bielefeld.de" + }, + { + "name": "Dominik Fladung", + "email": "dominik.fladung@gmx.de" } ], "autoload": { diff --git a/src/Annotation.php b/src/Annotation.php new file mode 100644 index 0000000..ce083ce --- /dev/null +++ b/src/Annotation.php @@ -0,0 +1,207 @@ +id = $data['id']; + $instance->image_id = $data['image_id']; + $instance->category_id = $data['category_id']; + $instance->bbox = $data['bbox'] ?? null; + $instance->segmentation = $data['segmentation'][0] ?? null; + + return $instance; + } + + // Validate the structure + public static function validate(array $data): void + { + $requiredKeys = ['id', 'image_id', 'category_id']; + foreach ($requiredKeys as $key) { + if (!array_key_exists($key, $data)) { + throw new \Exception("Missing key '$key' in Annotation"); + } + } + } + + public function getLabel(array $categories): Label + { + $categoryIndex = array_search($this->category_id, array_column($categories, 'id')); + $category = $categories[$categoryIndex]; + return new Label(id: $category->id, name: $category->name); + } + + public function getLabelAndUsers(array $categories): array + { + $cocoUser = Coco::getCocoUser(); + $label = $this->getLabel($categories); + return [new LabelAndUser(label: $label, user: $cocoUser)]; + } + + public function getPoints(): array + { + if ($this->getShape()->id === Shape::circleId()) { + return $this->getCirclePoints(); + } + return $this->segmentation; + } + + private function getGroupedPoints(): array + { + if ($this->groupedPoints) { + return $this->groupedPoints; + } + $groupedPoints = []; + for ($i = 0; $i < count($this->segmentation); $i += 2) { + $groupedPoints[] = ['x' => $this->segmentation[$i], 'y' => $this->segmentation[$i + 1]]; + } + $this->groupedPoints = $groupedPoints; + return $groupedPoints; + } + + private function getCirclePoints() + { + if($this->points) { + return $this->points; + } + // Split the coordinates into x, y pairs + $points = $this->getGroupedPoints(); + + // Calculate the average center (geometric center) of the points + $maxY = max(array_column($points, 'y')); + $minY = min(array_column($points, 'y')); + $maxX = max(array_column($points, 'x')); + $minX = min(array_column($points, 'x')); + $centerX = ($maxX + $minX) / 2; + $centerY = ($maxY + $minY) / 2; + + // Calculate the distance from the first point to the center (radius) + $initialRadius = $this->euclidean_distance($points[0]['x'], $points[0]['y'], $centerX, $centerY); + + $this->points = [$centerX, $centerY, $initialRadius]; + return $this->points; + } + + private function detectShape(): Shape + { + if (count($this->segmentation) < 2) { + return Shape::polygon(); + } + + if ($this->isPointShape()) { + return Shape::point(); + } + + if ($this->isRectangleShape()) { + return Shape::rectangle(); + } + + if ($this->isLineShape()) { + return Shape::line(); + } + + if ($this->isCircleShape()) { + return Shape::circle(); + } + + return Shape::polygon(); + } + + public function getShape(): Shape + { + if (!$this->shape) { + $this->shape = $this->detectShape(); + } + + return $this->shape; + } + + public function isPointShape(): bool + { + return count($this->segmentation) === 2; + } + + public function isLineShape(): bool + { + $segmentationCount = count($this->segmentation); + if ($segmentationCount < 4) { + return false; + } + + $x_1 = $this->segmentation[0]; + $y_1 = $this->segmentation[1]; + $x_last = $this->segmentation[$segmentationCount - 2]; + $y_last = $this->segmentation[$segmentationCount - 1]; + + return !($x_1 === $x_last && $y_1 === $y_last); + } + + public function isCircleShape(): bool + { + // Tolerance for floating-point comparison + $tolerance = 0.001; + $points = $this->getGroupedPoints(); + list($centerX, $centerY, $initialRadius) = $this->getCirclePoints(); + + // Check if all points are equidistant from the center + foreach ($points as $point) { + $radius = $this->euclidean_distance($point['x'], $point['y'], $centerX, $centerY); + if (abs($radius - $initialRadius) > $tolerance) { + return false; + } + } + + // If all points are within the tolerance range, they form a circle + return true; + } + + function euclidean_distance($x1, $y1, $x2, $y2) + { + return sqrt(pow($x2 - $x1, 2) + pow($y2 - $y1, 2)); + } + + public function isRectangleShape(): bool + { + if (count($this->segmentation) !== 8) { + return false; + } + + // Toleranz für Gleitkomma-Vergleiche + $tolerance = 0.01; + + // Punkte (x1, y1), (x2, y2), (x3, y3), (x4, y4) + list($x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4) = $this->segmentation; + + // Berechne die Seitenlängen + $d1 = $this->euclidean_distance($x1, $y1, $x2, $y2); // Distanz zwischen P1 und P2 + $d2 = $this->euclidean_distance($x2, $y2, $x3, $y3); // Distanz zwischen P2 und P3 + $d3 = $this->euclidean_distance($x3, $y3, $x4, $y4); // Distanz zwischen P3 und P4 + $d4 = $this->euclidean_distance($x4, $y4, $x1, $y1); // Distanz zwischen P4 und P1 + + // Berechne die Diagonalen + $diag1 = $this->euclidean_distance($x1, $y1, $x3, $y3); // Diagonale P1 -> P3 + $diag2 = $this->euclidean_distance($x2, $y2, $x4, $y4); // Diagonale P2 -> P4 + + // Prüfen, ob gegenüberliegende Seiten gleich lang sind und Diagonalen gleich lang sind + return abs($d1 - $d3) < $tolerance && abs($d2 - $d4) < $tolerance && abs($diag1 - $diag2) < $tolerance; + } +} diff --git a/src/Category.php b/src/Category.php new file mode 100644 index 0000000..013cc11 --- /dev/null +++ b/src/Category.php @@ -0,0 +1,31 @@ +id = $data['id']; + $instance->name = $data['name']; + + return $instance; + } + + // Validate the structure + public static function validate(array $data): void + { + $requiredKeys = ['id', 'name']; + foreach ($requiredKeys as $key) { + if (!array_key_exists($key, $data)) { + throw new \Exception("Missing key '$key' in Category"); + } + } + } +} diff --git a/src/Coco.php b/src/Coco.php new file mode 100644 index 0000000..74179f3 --- /dev/null +++ b/src/Coco.php @@ -0,0 +1,101 @@ +info = Info::create($data['info']); + } + + // Create the Image objects + $instance->images = array_map(function ($imageData) { + return Image::create($imageData); + }, $data['images']); + + // Create the Annotation objects + $instance->annotations = array_map(function ($annotationData) { + return Annotation::create($annotationData); + }, $data['annotations']); + + // Create the Category objects + $instance->categories = array_map(function ($categoryData) { + return Category::create($categoryData); + }, $data['categories']); + + // validate the data consistency + $instance->validateCategoriesInData(); + $instance->validateImagesInData(); + + return $instance; + } + + // Validate the top-level structure + public static function validate(array $data): void + { + $requiredKeys = ['images', 'annotations', 'categories']; + foreach ($requiredKeys as $key) { + if (!array_key_exists($key, $data)) { + throw new \Exception("Missing key '$key' in Coco"); + } + } + } + + public function validateCategoriesInData(): void + { + $categoryIds = array_map(function ($category) { + return $category->id; + }, $this->categories); + + foreach ($this->annotations as $annotation) { + if (!in_array($annotation->category_id, $categoryIds)) { + throw new \Exception("Invalid category ID '{$annotation['category_id']}' in annotation '{$annotation['id']}'"); + } + } + } + + public function validateImagesInData(): void + { + $imageIds = array_map(function ($image) { + return $image->id; + }, $this->images); + + foreach ($this->annotations as $annotation) { + if (!in_array($annotation->image_id, $imageIds)) { + throw new \Exception("Invalid image ID '{$annotation['image_id']}' in annotation '{$annotation['id']}'"); + } + } + } +} diff --git a/src/CocoParser.php b/src/CocoParser.php index 94b9e59..c7b7505 100644 --- a/src/CocoParser.php +++ b/src/CocoParser.php @@ -1,15 +1,24 @@ coco) { + $file = parent::getFileObject(); + $this->coco = Coco::createFromPath($file->getRealPath()); + } + + return $this->coco; + } + /** * {@inheritdoc} */ public function recognizesFile(): bool { - // TODO + try { + $this->getCoco(); + } catch (\Exception $e) { + return false; + } + + return true; } /** @@ -36,6 +61,41 @@ public function recognizesFile(): bool */ public function getMetadata(): VolumeMetadata { - // TODO + $coco = $this->getCoco(); + + $metadata = new VolumeMetadata( + type: MediaType::image(), + name: $coco->info->description ?? null, + url: null, + handle: null, + ); + + foreach ($coco->images as $image) { + $imageMetaData = new ImageMetadata( + name: $image->file_name + ); + + $this->processImageAnnotations($image, $imageMetaData); + + $metadata->addFile($imageMetaData); + } + + return $metadata; + } + + private function processImageAnnotations(Image $image, ImageMetadata $imageMetaData) + { + $annotations = array_filter($this->getCoco()->annotations, function ($annotation) use ($image) { + return $annotation->image_id === $image->id; + }); + + foreach ($annotations as $annotation) { + $metaDataAnnotation = new ImageAnnotation( + shape: $annotation->getShape(), + points: $annotation->getPoints(), + labels: $annotation->getLabelAndUsers($this->getCoco()->categories), + ); + $imageMetaData->addAnnotation($metaDataAnnotation); + } } } diff --git a/src/Image.php b/src/Image.php new file mode 100644 index 0000000..6bda21c --- /dev/null +++ b/src/Image.php @@ -0,0 +1,44 @@ +id = $data['id']; + $instance->width = $data['width']; + $instance->height = $data['height']; + $instance->file_name = $data['file_name']; + $instance->license = $data['license'] ?? null; + $instance->flickr_url = $data['flickr_url'] ?? null; + $instance->coco_url = $data['coco_url'] ?? null; + $instance->date_captured = $data['date_captured'] ?? null; + + return $instance; + } + + // Validate the structure + public static function validate(array $data): void + { + $requiredKeys = ['id', 'width', 'height', 'file_name']; + foreach ($requiredKeys as $key) { + if (!array_key_exists($key, $data)) { + throw new \Exception("Missing key '$key' in Image"); + } + } + } +} diff --git a/src/Info.php b/src/Info.php new file mode 100644 index 0000000..daca85c --- /dev/null +++ b/src/Info.php @@ -0,0 +1,27 @@ +year = $data['year'] ?? null; + $instance->version = $data['version'] ?? null; + $instance->description = $data['description'] ?? null; + $instance->contributor = $data['contributor'] ?? null; + $instance->url = $data['url'] ?? null; + $instance->date_created = $data['date_created'] ?? null; + + return $instance; + } +} diff --git a/tests/CocoParserTest.php b/tests/CocoParserTest.php index 997185b..bb49dc2 100644 --- a/tests/CocoParserTest.php +++ b/tests/CocoParserTest.php @@ -1,17 +1,311 @@ assertTrue($parser->recognizesFile()); + } + + public function testRecognizesCorrectFileWithAdditionalData() { - // + $file = new File(__DIR__ . "/files/additional-data-coco-import-volume.json"); + $parser = new CocoParser($file); + $this->assertTrue($parser->recognizesFile()); + } + + public function testRecognizesMissingCategoryFile() + { + $file = new File(__DIR__ . "/files/missing-category-coco-import-volume.json"); + $parser = new CocoParser($file); + $this->assertFalse($parser->recognizesFile()); + } + + public function testRecognizesEmptyFile() + { + $file = new File(__DIR__ . "/files/empty.json"); + $parser = new CocoParser($file); + $this->assertFalse($parser->recognizesFile()); } public function testGetMetadata() { - // + $file = new File(__DIR__ . "/files/full-coco-import-volume.json"); + $parser = new CocoParser($file); + $metadata = $parser->getMetadata(); + + $this->assertSame(MediaType::imageId(), $metadata->type->id); + $this->assertSame("COCO 2017 Volume", $metadata->name); + $this->assertNull($metadata->url); + $this->assertNull($metadata->handle); + + $this->assertCount(1, $metadata->getFiles()); + + $file = $metadata->getFiles()->first(); + $this->assertSame("31c3-Wimmelbild-ccby.jpg", $file->name); + $this->assertSame(null, $file->lng); + $this->assertSame(null, $file->lat); + + $this->assertTrue($metadata->hasAnnotations()); + + $annotations = $file->getAnnotations(); + $this->assertCount(6, $annotations); + $this->assertSame(Shape::rectangle(), $annotations[0]->shape); + $this->assertSame(Shape::circle(), $annotations[1]->shape); + $this->assertSame(Shape::line(), $annotations[2]->shape); + $this->assertSame(Shape::polygon(), $annotations[3]->shape); + $this->assertSame(Shape::rectangle(), $annotations[4]->shape); + $this->assertSame(Shape::polygon(), $annotations[5]->shape); + + $this->assertSame($annotations[0]->points, [ + 1853.22, + 596.22, + 1776.16, + 799.04, + 1597.21, + 731.04, + 1674.27, + 528.23 + ]); + + $users = $file->getUsers(); + $cocoUser = Coco::getCocoUser(); + $this->assertCount(1, $users); + $this->assertSame($cocoUser->name, $users[array_key_first($users)]->name); + + $labels = $file->getAnnotationLabels(); + $this->assertCount(1, $labels); + $this->assertSame("Animal", $labels[array_key_first($labels)]->name); + + $this->assertSame("Animal", $annotations[0]->labels[0]->label->name); + $this->assertSame("Animal", $annotations[1]->labels[0]->label->name); + $this->assertSame("Animal", $annotations[2]->labels[0]->label->name); + $this->assertSame("Animal", $annotations[3]->labels[0]->label->name); + $this->assertSame("Animal", $annotations[4]->labels[0]->label->name); + $this->assertSame("Animal", $annotations[5]->labels[0]->label->name); + } + + public function testIsPointShape() + { + $pointAnnotation = Annotation::create([ + 'id' => 1, + 'image_id' => 1, + 'category_id' => 1, + 'bbox' => null, + 'segmentation' => [[1, 1]] + ]); + $this->assertTrue($pointAnnotation->isPointShape()); + $this->assertSame($pointAnnotation->getShape(), Shape::point()); + } + + public function testIsRectangleShape() + { + $rectangleAnnotation = Annotation::create([ + 'id' => 1, + 'image_id' => 1, + 'category_id' => 1, + 'bbox' => null, + 'segmentation' => [ + [ + 1853.22, + 596.22, + + 1776.16, + 799.04, + + 1597.21, + 731.04, + + 1674.27, + 528.23 + ] + ], + ]); + $this->assertTrue($rectangleAnnotation->isRectangleShape()); + $this->assertSame($rectangleAnnotation->getShape(), Shape::rectangle()); + $this->assertSame($rectangleAnnotation->getPoints(), $rectangleAnnotation->segmentation); + } + + public function testIsCircleShape() + { + $circleAnnotation = Annotation::create([ + 'id' => 1, + 'image_id' => 1, + 'category_id' => 1, + 'bbox' => null, + 'segmentation' => [[ + 1474.3300000000002, + 1165.54, + 1473.8187624307873, + 1155.1335202112105, + 1472.289973220411, + 1144.8272605115476, + 1469.7583554446887, + 1134.7204758158937, + 1466.2482899667234, + 1124.9104999857984, + 1461.793580635865, + 1115.4918084511837, + 1456.4371287381614, + 1106.5551083603089, + 1450.2305198335218, + 1098.1864650203456, + 1443.2335269585758, + 1090.4664730414243, + 1435.5135349796544, + 1083.4694801664782, + 1427.1448916396912, + 1077.2628712618387, + 1418.2081915488163, + 1071.9064193641352, + 1408.7895000142016, + 1067.4517100332766, + 1398.9795241841064, + 1063.9416445553113, + 1388.8727394884525, + 1061.410026779589, + 1378.5664797887896, + 1059.8812375692128, + 1368.16, + 1059.37, + 1357.7535202112106, + 1059.8812375692128, + 1347.4472605115477, + 1061.410026779589, + 1337.3404758158938, + 1063.9416445553113, + 1327.5304999857985, + 1067.4517100332766, + 1318.1118084511838, + 1071.9064193641352, + 1309.175108360309, + 1077.2628712618387, + 1300.806465020346, + 1083.4694801664782, + 1293.0864730414244, + 1090.4664730414243, + 1286.0894801664783, + 1098.1864650203456, + 1279.8828712618388, + 1106.5551083603089, + 1274.5264193641353, + 1115.4918084511837, + 1270.0717100332768, + 1124.9104999857984, + 1266.5616445553114, + 1134.7204758158937, + 1264.0300267795892, + 1144.8272605115476, + 1262.501237569213, + 1155.1335202112105, + 1261.99, + 1165.54, + 1262.501237569213, + 1175.9464797887895, + 1264.0300267795892, + 1186.2527394884523, + 1266.5616445553114, + 1196.3595241841062, + 1270.0717100332768, + 1206.1695000142015, + 1274.526419364135, + 1215.5881915488162, + 1279.8828712618388, + 1224.524891639691, + 1286.0894801664783, + 1232.893534979654, + 1293.0864730414244, + 1240.6135269585757, + 1300.8064650203457, + 1247.6105198335217, + 1309.175108360309, + 1253.8171287381613, + 1318.1118084511838, + 1259.1735806358647, + 1327.5304999857985, + 1263.6282899667233, + 1337.3404758158938, + 1267.1383554446886, + 1347.4472605115477, + 1269.6699732204108, + 1357.7535202112106, + 1271.1987624307872, + 1368.16, + 1271.71, + 1378.5664797887894, + 1271.1987624307872, + 1388.8727394884525, + 1269.6699732204108, + 1398.9795241841064, + 1267.1383554446886, + 1408.7895000142016, + 1263.6282899667233, + 1418.2081915488163, + 1259.1735806358647, + 1427.1448916396912, + 1253.8171287381613, + 1435.5135349796544, + 1247.6105198335217, + 1443.2335269585758, + 1240.6135269585757, + 1450.2305198335218, + 1232.8935349796543, + 1456.4371287381614, + 1224.524891639691, + 1461.7935806358648, + 1215.5881915488162, + 1466.2482899667234, + 1206.1695000142015, + 1469.7583554446887, + 1196.3595241841062, + 1472.289973220411, + 1186.2527394884523, + 1473.8187624307873, + 1175.9464797887895, + 1474.3300000000002, + 1165.54 + ]] + ]); + $this->assertTrue($circleAnnotation->isCircleShape()); + $this->assertSame($circleAnnotation->getShape(), Shape::circle()); + $this->assertSame($circleAnnotation->getPoints(), [1368.16, 1165.54, 106.17000000000007]); + } + + public function testIsLineShape() + { + $lineAnnotation = Annotation::create([ + 'id' => 1, + 'image_id' => 1, + 'category_id' => 1, + 'bbox' => null, + 'segmentation' => [[1, 1, 2, 2, 3, 3, 2, 2]] + ]); + $this->assertTrue($lineAnnotation->isLineShape()); + $this->assertSame($lineAnnotation->getShape(), Shape::line()); + } + + public function testIsPolygonShape() + { + $polygonAnnotation = Annotation::create([ + 'id' => 1, + 'image_id' => 1, + 'category_id' => 1, + 'bbox' => null, + 'segmentation' => [[1, 1, 2, 2, 3, 3, 4, 4, 1, 1]] + ]); + $this->assertSame($polygonAnnotation->getShape(), Shape::polygon()); } } diff --git a/tests/files/additional-data-coco-import-volume.json b/tests/files/additional-data-coco-import-volume.json new file mode 100644 index 0000000..6ba2b69 --- /dev/null +++ b/tests/files/additional-data-coco-import-volume.json @@ -0,0 +1,681 @@ +{ + "foo": "bar", + "images": [ + { + "height": 1775, + "width": 2500, + "id": 5588064, + "file_name": "31c3-Wimmelbild-ccby.jpg", + "longitude": null, + "latitude": null + } + ], + "categories": [ + { + "id": 15, + "name": "Animal" + } + ], + "annotations": [ + { + "segmentation": [ + [ + 1853.22, + 596.22, + 1776.16, + 799.04, + 1597.21, + 731.04, + 1674.27, + 528.23 + ] + ], + "iscrowd": 0, + "area": 69330.06809999999, + "image_id": 5588064, + "bbox": [ + 1597.21, + 528.23, + 256.01, + 270.80999999999995 + ], + "category_id": 15, + "id": 38917020 + }, + { + "segmentation": [ + [ + 1474.3300000000002, + 1165.54, + 1473.8187624307873, + 1155.1335202112105, + 1472.289973220411, + 1144.8272605115476, + 1469.7583554446887, + 1134.7204758158937, + 1466.2482899667234, + 1124.9104999857984, + 1461.793580635865, + 1115.4918084511837, + 1456.4371287381614, + 1106.5551083603089, + 1450.2305198335218, + 1098.1864650203456, + 1443.2335269585758, + 1090.4664730414243, + 1435.5135349796544, + 1083.4694801664782, + 1427.1448916396912, + 1077.2628712618387, + 1418.2081915488163, + 1071.9064193641352, + 1408.7895000142016, + 1067.4517100332766, + 1398.9795241841064, + 1063.9416445553113, + 1388.8727394884525, + 1061.410026779589, + 1378.5664797887896, + 1059.8812375692128, + 1368.16, + 1059.37, + 1357.7535202112106, + 1059.8812375692128, + 1347.4472605115477, + 1061.410026779589, + 1337.3404758158938, + 1063.9416445553113, + 1327.5304999857985, + 1067.4517100332766, + 1318.1118084511838, + 1071.9064193641352, + 1309.175108360309, + 1077.2628712618387, + 1300.806465020346, + 1083.4694801664782, + 1293.0864730414244, + 1090.4664730414243, + 1286.0894801664783, + 1098.1864650203456, + 1279.8828712618388, + 1106.5551083603089, + 1274.5264193641353, + 1115.4918084511837, + 1270.0717100332768, + 1124.9104999857984, + 1266.5616445553114, + 1134.7204758158937, + 1264.0300267795892, + 1144.8272605115476, + 1262.501237569213, + 1155.1335202112105, + 1261.99, + 1165.54, + 1262.501237569213, + 1175.9464797887895, + 1264.0300267795892, + 1186.2527394884523, + 1266.5616445553114, + 1196.3595241841062, + 1270.0717100332768, + 1206.1695000142015, + 1274.526419364135, + 1215.5881915488162, + 1279.8828712618388, + 1224.524891639691, + 1286.0894801664783, + 1232.893534979654, + 1293.0864730414244, + 1240.6135269585757, + 1300.8064650203457, + 1247.6105198335217, + 1309.175108360309, + 1253.8171287381613, + 1318.1118084511838, + 1259.1735806358647, + 1327.5304999857985, + 1263.6282899667233, + 1337.3404758158938, + 1267.1383554446886, + 1347.4472605115477, + 1269.6699732204108, + 1357.7535202112106, + 1271.1987624307872, + 1368.16, + 1271.71, + 1378.5664797887894, + 1271.1987624307872, + 1388.8727394884525, + 1269.6699732204108, + 1398.9795241841064, + 1267.1383554446886, + 1408.7895000142016, + 1263.6282899667233, + 1418.2081915488163, + 1259.1735806358647, + 1427.1448916396912, + 1253.8171287381613, + 1435.5135349796544, + 1247.6105198335217, + 1443.2335269585758, + 1240.6135269585757, + 1450.2305198335218, + 1232.8935349796543, + 1456.4371287381614, + 1224.524891639691, + 1461.7935806358648, + 1215.5881915488162, + 1466.2482899667234, + 1206.1695000142015, + 1469.7583554446887, + 1196.3595241841062, + 1472.289973220411, + 1186.2527394884523, + 1473.8187624307873, + 1175.9464797887895, + 1474.3300000000002, + 1165.54 + ] + ], + "iscrowd": 0, + "area": 45088.27560000006, + "image_id": 5588064, + "bbox": [ + 1261.99, + 1059.37, + 212.34000000000015, + 212.34000000000015 + ], + "category_id": 15, + "id": 38917021 + }, + { + "segmentation": [ + [ + 957.16, + 1368.35, + 731.11, + 1465.91, + 623.23, + 1327.28 + ] + ], + "iscrowd": 0, + "area": 46292.71590000003, + "image_id": 5588064, + "bbox": [ + 623.23, + 1327.28, + 333.92999999999995, + 138.6300000000001 + ], + "category_id": 15, + "id": 38917022 + }, + { + "segmentation": [ + [ + 2030.9, + 1060.28, + 1707.24, + 1304.17, + 2038.6, + 1478.75, + 2303.18, + 1268.23, + 2277.5, + 944.75, + 2107.96, + 862.6, + 2030.9, + 1060.28 + ] + ], + "iscrowd": 0, + "area": 367188.43099999987, + "image_id": 5588064, + "bbox": [ + 1707.24, + 862.6, + 595.9399999999998, + 616.15 + ], + "category_id": 15, + "id": 38917023 + }, + { + "segmentation": [ + [ + 828.73, + 261.85, + 828.73, + 580.19, + 1357.89, + 580.19, + 1357.89, + 261.85 + ] + ], + "iscrowd": 0, + "area": 168452.79440000004, + "image_id": 5588064, + "bbox": [ + 828.73, + 261.85, + 529.1600000000001, + 318.34000000000003 + ], + "category_id": 15, + "id": 38917024 + }, + { + "segmentation": [ + [ + 625, + 1022.95, + 634.77, + 1022.95, + 639.65, + 1027.83, + 642.09, + 1027.83, + 656.74, + 1042.48, + 659.18, + 1042.48, + 664.06, + 1047.36, + 666.5, + 1047.36, + 671.39, + 1052.25, + 673.83, + 1052.25, + 681.15, + 1059.57, + 683.59, + 1059.57, + 688.48, + 1064.45, + 690.92, + 1064.45, + 695.8, + 1069.34, + 698.24, + 1069.34, + 700.68, + 1071.78, + 703.13, + 1071.78, + 703.13, + 1074.22, + 705.57, + 1076.66, + 705.57, + 1091.31, + 703.13, + 1093.75, + 703.13, + 1098.63, + 705.57, + 1101.07, + 717.77, + 1101.07, + 725.1, + 1093.75, + 727.54, + 1096.19, + 727.54, + 1098.63, + 729.98, + 1101.07, + 729.98, + 1105.96, + 734.86, + 1110.84, + 742.19, + 1103.52, + 747.07, + 1103.52, + 754.39, + 1110.84, + 756.84, + 1110.84, + 761.72, + 1115.72, + 764.16, + 1115.72, + 766.6, + 1118.16, + 769.04, + 1118.16, + 776.37, + 1125.49, + 778.81, + 1125.49, + 791.02, + 1137.7, + 793.46, + 1137.7, + 795.9, + 1140.14, + 798.34, + 1140.14, + 805.66, + 1147.46, + 803.22, + 1149.9, + 803.22, + 1162.11, + 791.02, + 1162.11, + 788.57, + 1164.55, + 781.25, + 1164.55, + 778.81, + 1166.99, + 776.37, + 1166.99, + 773.93, + 1169.43, + 771.48, + 1169.43, + 769.04, + 1171.88, + 766.6, + 1171.88, + 761.72, + 1176.76, + 761.72, + 1179.2, + 759.28, + 1181.64, + 759.28, + 1186.52, + 756.84, + 1188.96, + 756.84, + 1196.29, + 754.39, + 1198.73, + 754.39, + 1203.61, + 747.07, + 1210.94, + 744.63, + 1210.94, + 739.75, + 1215.82, + 737.3, + 1215.82, + 725.1, + 1228.03, + 722.66, + 1228.03, + 698.24, + 1252.44, + 695.8, + 1252.44, + 693.36, + 1254.88, + 693.36, + 1257.32, + 690.92, + 1259.77, + 690.92, + 1296.39, + 693.36, + 1298.83, + 693.36, + 1308.59, + 690.92, + 1311.04, + 686.04, + 1311.04, + 686.04, + 1308.59, + 681.15, + 1303.71, + 681.15, + 1264.65, + 678.71, + 1262.21, + 678.71, + 1259.77, + 671.39, + 1252.44, + 668.95, + 1252.44, + 659.18, + 1242.68, + 656.74, + 1242.68, + 651.86, + 1247.56, + 651.86, + 1286.62, + 654.3, + 1289.06, + 654.3, + 1296.39, + 649.41, + 1301.27, + 646.97, + 1301.27, + 639.65, + 1293.95, + 639.65, + 1291.5, + 637.21, + 1289.06, + 629.88, + 1289.06, + 627.44, + 1286.62, + 627.44, + 1267.09, + 625, + 1264.65, + 625, + 1257.32, + 627.44, + 1254.88, + 625, + 1252.44, + 625, + 1247.56, + 622.56, + 1245.12, + 622.56, + 1235.35, + 620.12, + 1232.91, + 620.12, + 1220.7, + 615.23, + 1215.82, + 612.79, + 1215.82, + 610.35, + 1213.38, + 607.91, + 1213.38, + 605.47, + 1210.94, + 603.03, + 1210.94, + 598.14, + 1206.05, + 595.7, + 1206.05, + 595.7, + 1186.52, + 600.59, + 1181.64, + 605.47, + 1181.64, + 612.79, + 1174.32, + 612.79, + 1171.88, + 610.35, + 1169.43, + 610.35, + 1166.99, + 603.03, + 1159.67, + 603.03, + 1157.23, + 595.7, + 1149.9, + 588.38, + 1149.9, + 581.05, + 1157.23, + 581.05, + 1159.67, + 576.17, + 1164.55, + 576.17, + 1166.99, + 571.29, + 1171.88, + 563.96, + 1171.88, + 561.52, + 1169.43, + 554.2, + 1169.43, + 554.2, + 1166.99, + 546.88, + 1159.67, + 544.43, + 1159.67, + 539.55, + 1154.79, + 532.23, + 1154.79, + 529.79, + 1157.23, + 529.79, + 1171.88, + 532.23, + 1174.32, + 532.23, + 1208.5, + 524.9, + 1208.5, + 522.46, + 1206.05, + 522.46, + 1193.85, + 520.02, + 1191.41, + 520.02, + 1171.88, + 517.58, + 1169.43, + 517.58, + 1157.23, + 515.14, + 1154.79, + 515.14, + 1140.14, + 512.7, + 1137.7, + 512.7, + 1130.37, + 510.25, + 1127.93, + 510.25, + 1125.49, + 512.7, + 1123.05, + 512.7, + 1118.16, + 527.34, + 1103.52, + 529.79, + 1103.52, + 544.43, + 1088.87, + 546.88, + 1088.87, + 549.32, + 1086.43, + 551.76, + 1086.43, + 554.2, + 1083.98, + 566.41, + 1083.98, + 568.85, + 1086.43, + 573.73, + 1086.43, + 576.17, + 1088.87, + 581.05, + 1088.87, + 588.38, + 1081.54, + 588.38, + 1076.66, + 590.82, + 1074.22, + 593.26, + 1076.66, + 598.14, + 1076.66, + 603.03, + 1071.78, + 603.03, + 1066.89, + 600.59, + 1064.45, + 593.26, + 1064.45, + 590.82, + 1062.01, + 588.38, + 1062.01, + 585.94, + 1059.57, + 585.94, + 1057.13, + 588.38, + 1054.69, + 590.82, + 1054.69, + 593.26, + 1052.25, + 595.7, + 1052.25, + 600.59, + 1047.36, + 600.59, + 1040.04, + 610.35, + 1030.27, + 617.68, + 1030.27, + 625, + 1022.95 + ] + ], + "iscrowd": 0, + "area": 85104.66689999997, + "image_id": 5588064, + "bbox": [ + 510.25, + 1022.95, + 295.40999999999997, + 288.0899999999999 + ], + "category_id": 15, + "id": 38917025 + } + ] +} \ No newline at end of file diff --git a/tests/files/empty.json b/tests/files/empty.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/tests/files/empty.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/files/full-coco-import-volume.json b/tests/files/full-coco-import-volume.json new file mode 100644 index 0000000..a72d7eb --- /dev/null +++ b/tests/files/full-coco-import-volume.json @@ -0,0 +1,684 @@ +{ + "info": { + "description": "COCO 2017 Volume", + "url": "http://cocodataset.org" + }, + "images": [ + { + "height": 1775, + "width": 2500, + "id": 5588064, + "file_name": "31c3-Wimmelbild-ccby.jpg", + "longitude": null, + "latitude": null + } + ], + "categories": [ + { + "id": 15, + "name": "Animal" + } + ], + "annotations": [ + { + "segmentation": [ + [ + 1853.22, + 596.22, + 1776.16, + 799.04, + 1597.21, + 731.04, + 1674.27, + 528.23 + ] + ], + "iscrowd": 0, + "area": 69330.06809999999, + "image_id": 5588064, + "bbox": [ + 1597.21, + 528.23, + 256.01, + 270.80999999999995 + ], + "category_id": 15, + "id": 38917020 + }, + { + "segmentation": [ + [ + 1474.3300000000002, + 1165.54, + 1473.8187624307873, + 1155.1335202112105, + 1472.289973220411, + 1144.8272605115476, + 1469.7583554446887, + 1134.7204758158937, + 1466.2482899667234, + 1124.9104999857984, + 1461.793580635865, + 1115.4918084511837, + 1456.4371287381614, + 1106.5551083603089, + 1450.2305198335218, + 1098.1864650203456, + 1443.2335269585758, + 1090.4664730414243, + 1435.5135349796544, + 1083.4694801664782, + 1427.1448916396912, + 1077.2628712618387, + 1418.2081915488163, + 1071.9064193641352, + 1408.7895000142016, + 1067.4517100332766, + 1398.9795241841064, + 1063.9416445553113, + 1388.8727394884525, + 1061.410026779589, + 1378.5664797887896, + 1059.8812375692128, + 1368.16, + 1059.37, + 1357.7535202112106, + 1059.8812375692128, + 1347.4472605115477, + 1061.410026779589, + 1337.3404758158938, + 1063.9416445553113, + 1327.5304999857985, + 1067.4517100332766, + 1318.1118084511838, + 1071.9064193641352, + 1309.175108360309, + 1077.2628712618387, + 1300.806465020346, + 1083.4694801664782, + 1293.0864730414244, + 1090.4664730414243, + 1286.0894801664783, + 1098.1864650203456, + 1279.8828712618388, + 1106.5551083603089, + 1274.5264193641353, + 1115.4918084511837, + 1270.0717100332768, + 1124.9104999857984, + 1266.5616445553114, + 1134.7204758158937, + 1264.0300267795892, + 1144.8272605115476, + 1262.501237569213, + 1155.1335202112105, + 1261.99, + 1165.54, + 1262.501237569213, + 1175.9464797887895, + 1264.0300267795892, + 1186.2527394884523, + 1266.5616445553114, + 1196.3595241841062, + 1270.0717100332768, + 1206.1695000142015, + 1274.526419364135, + 1215.5881915488162, + 1279.8828712618388, + 1224.524891639691, + 1286.0894801664783, + 1232.893534979654, + 1293.0864730414244, + 1240.6135269585757, + 1300.8064650203457, + 1247.6105198335217, + 1309.175108360309, + 1253.8171287381613, + 1318.1118084511838, + 1259.1735806358647, + 1327.5304999857985, + 1263.6282899667233, + 1337.3404758158938, + 1267.1383554446886, + 1347.4472605115477, + 1269.6699732204108, + 1357.7535202112106, + 1271.1987624307872, + 1368.16, + 1271.71, + 1378.5664797887894, + 1271.1987624307872, + 1388.8727394884525, + 1269.6699732204108, + 1398.9795241841064, + 1267.1383554446886, + 1408.7895000142016, + 1263.6282899667233, + 1418.2081915488163, + 1259.1735806358647, + 1427.1448916396912, + 1253.8171287381613, + 1435.5135349796544, + 1247.6105198335217, + 1443.2335269585758, + 1240.6135269585757, + 1450.2305198335218, + 1232.8935349796543, + 1456.4371287381614, + 1224.524891639691, + 1461.7935806358648, + 1215.5881915488162, + 1466.2482899667234, + 1206.1695000142015, + 1469.7583554446887, + 1196.3595241841062, + 1472.289973220411, + 1186.2527394884523, + 1473.8187624307873, + 1175.9464797887895, + 1474.3300000000002, + 1165.54 + ] + ], + "iscrowd": 0, + "area": 45088.27560000006, + "image_id": 5588064, + "bbox": [ + 1261.99, + 1059.37, + 212.34000000000015, + 212.34000000000015 + ], + "category_id": 15, + "id": 38917021 + }, + { + "segmentation": [ + [ + 957.16, + 1368.35, + 731.11, + 1465.91, + 623.23, + 1327.28 + ] + ], + "iscrowd": 0, + "area": 46292.71590000003, + "image_id": 5588064, + "bbox": [ + 623.23, + 1327.28, + 333.92999999999995, + 138.6300000000001 + ], + "category_id": 15, + "id": 38917022 + }, + { + "segmentation": [ + [ + 2030.9, + 1060.28, + 1707.24, + 1304.17, + 2038.6, + 1478.75, + 2303.18, + 1268.23, + 2277.5, + 944.75, + 2107.96, + 862.6, + 2030.9, + 1060.28 + ] + ], + "iscrowd": 0, + "area": 367188.43099999987, + "image_id": 5588064, + "bbox": [ + 1707.24, + 862.6, + 595.9399999999998, + 616.15 + ], + "category_id": 15, + "id": 38917023 + }, + { + "segmentation": [ + [ + 828.73, + 261.85, + 828.73, + 580.19, + 1357.89, + 580.19, + 1357.89, + 261.85 + ] + ], + "iscrowd": 0, + "area": 168452.79440000004, + "image_id": 5588064, + "bbox": [ + 828.73, + 261.85, + 529.1600000000001, + 318.34000000000003 + ], + "category_id": 15, + "id": 38917024 + }, + { + "segmentation": [ + [ + 625, + 1022.95, + 634.77, + 1022.95, + 639.65, + 1027.83, + 642.09, + 1027.83, + 656.74, + 1042.48, + 659.18, + 1042.48, + 664.06, + 1047.36, + 666.5, + 1047.36, + 671.39, + 1052.25, + 673.83, + 1052.25, + 681.15, + 1059.57, + 683.59, + 1059.57, + 688.48, + 1064.45, + 690.92, + 1064.45, + 695.8, + 1069.34, + 698.24, + 1069.34, + 700.68, + 1071.78, + 703.13, + 1071.78, + 703.13, + 1074.22, + 705.57, + 1076.66, + 705.57, + 1091.31, + 703.13, + 1093.75, + 703.13, + 1098.63, + 705.57, + 1101.07, + 717.77, + 1101.07, + 725.1, + 1093.75, + 727.54, + 1096.19, + 727.54, + 1098.63, + 729.98, + 1101.07, + 729.98, + 1105.96, + 734.86, + 1110.84, + 742.19, + 1103.52, + 747.07, + 1103.52, + 754.39, + 1110.84, + 756.84, + 1110.84, + 761.72, + 1115.72, + 764.16, + 1115.72, + 766.6, + 1118.16, + 769.04, + 1118.16, + 776.37, + 1125.49, + 778.81, + 1125.49, + 791.02, + 1137.7, + 793.46, + 1137.7, + 795.9, + 1140.14, + 798.34, + 1140.14, + 805.66, + 1147.46, + 803.22, + 1149.9, + 803.22, + 1162.11, + 791.02, + 1162.11, + 788.57, + 1164.55, + 781.25, + 1164.55, + 778.81, + 1166.99, + 776.37, + 1166.99, + 773.93, + 1169.43, + 771.48, + 1169.43, + 769.04, + 1171.88, + 766.6, + 1171.88, + 761.72, + 1176.76, + 761.72, + 1179.2, + 759.28, + 1181.64, + 759.28, + 1186.52, + 756.84, + 1188.96, + 756.84, + 1196.29, + 754.39, + 1198.73, + 754.39, + 1203.61, + 747.07, + 1210.94, + 744.63, + 1210.94, + 739.75, + 1215.82, + 737.3, + 1215.82, + 725.1, + 1228.03, + 722.66, + 1228.03, + 698.24, + 1252.44, + 695.8, + 1252.44, + 693.36, + 1254.88, + 693.36, + 1257.32, + 690.92, + 1259.77, + 690.92, + 1296.39, + 693.36, + 1298.83, + 693.36, + 1308.59, + 690.92, + 1311.04, + 686.04, + 1311.04, + 686.04, + 1308.59, + 681.15, + 1303.71, + 681.15, + 1264.65, + 678.71, + 1262.21, + 678.71, + 1259.77, + 671.39, + 1252.44, + 668.95, + 1252.44, + 659.18, + 1242.68, + 656.74, + 1242.68, + 651.86, + 1247.56, + 651.86, + 1286.62, + 654.3, + 1289.06, + 654.3, + 1296.39, + 649.41, + 1301.27, + 646.97, + 1301.27, + 639.65, + 1293.95, + 639.65, + 1291.5, + 637.21, + 1289.06, + 629.88, + 1289.06, + 627.44, + 1286.62, + 627.44, + 1267.09, + 625, + 1264.65, + 625, + 1257.32, + 627.44, + 1254.88, + 625, + 1252.44, + 625, + 1247.56, + 622.56, + 1245.12, + 622.56, + 1235.35, + 620.12, + 1232.91, + 620.12, + 1220.7, + 615.23, + 1215.82, + 612.79, + 1215.82, + 610.35, + 1213.38, + 607.91, + 1213.38, + 605.47, + 1210.94, + 603.03, + 1210.94, + 598.14, + 1206.05, + 595.7, + 1206.05, + 595.7, + 1186.52, + 600.59, + 1181.64, + 605.47, + 1181.64, + 612.79, + 1174.32, + 612.79, + 1171.88, + 610.35, + 1169.43, + 610.35, + 1166.99, + 603.03, + 1159.67, + 603.03, + 1157.23, + 595.7, + 1149.9, + 588.38, + 1149.9, + 581.05, + 1157.23, + 581.05, + 1159.67, + 576.17, + 1164.55, + 576.17, + 1166.99, + 571.29, + 1171.88, + 563.96, + 1171.88, + 561.52, + 1169.43, + 554.2, + 1169.43, + 554.2, + 1166.99, + 546.88, + 1159.67, + 544.43, + 1159.67, + 539.55, + 1154.79, + 532.23, + 1154.79, + 529.79, + 1157.23, + 529.79, + 1171.88, + 532.23, + 1174.32, + 532.23, + 1208.5, + 524.9, + 1208.5, + 522.46, + 1206.05, + 522.46, + 1193.85, + 520.02, + 1191.41, + 520.02, + 1171.88, + 517.58, + 1169.43, + 517.58, + 1157.23, + 515.14, + 1154.79, + 515.14, + 1140.14, + 512.7, + 1137.7, + 512.7, + 1130.37, + 510.25, + 1127.93, + 510.25, + 1125.49, + 512.7, + 1123.05, + 512.7, + 1118.16, + 527.34, + 1103.52, + 529.79, + 1103.52, + 544.43, + 1088.87, + 546.88, + 1088.87, + 549.32, + 1086.43, + 551.76, + 1086.43, + 554.2, + 1083.98, + 566.41, + 1083.98, + 568.85, + 1086.43, + 573.73, + 1086.43, + 576.17, + 1088.87, + 581.05, + 1088.87, + 588.38, + 1081.54, + 588.38, + 1076.66, + 590.82, + 1074.22, + 593.26, + 1076.66, + 598.14, + 1076.66, + 603.03, + 1071.78, + 603.03, + 1066.89, + 600.59, + 1064.45, + 593.26, + 1064.45, + 590.82, + 1062.01, + 588.38, + 1062.01, + 585.94, + 1059.57, + 585.94, + 1057.13, + 588.38, + 1054.69, + 590.82, + 1054.69, + 593.26, + 1052.25, + 595.7, + 1052.25, + 600.59, + 1047.36, + 600.59, + 1040.04, + 610.35, + 1030.27, + 617.68, + 1030.27, + 625, + 1022.95 + ] + ], + "iscrowd": 0, + "area": 85104.66689999997, + "image_id": 5588064, + "bbox": [ + 510.25, + 1022.95, + 295.40999999999997, + 288.0899999999999 + ], + "category_id": 15, + "id": 38917025 + } + ] +} \ No newline at end of file diff --git a/tests/files/missing-category-coco-import-volume.json b/tests/files/missing-category-coco-import-volume.json new file mode 100644 index 0000000..f155c4b --- /dev/null +++ b/tests/files/missing-category-coco-import-volume.json @@ -0,0 +1,245 @@ +{ + "images": [ + { + "height": 1775, + "width": 2500, + "id": 5588064, + "file_name": "31c3-Wimmelbild-ccby.jpg", + "longitude": null, + "latitude": null + } + ], + "annotations": [ + { + "segmentation": [ + [ + 1853.22, + 596.22, + + 1776.16, + 799.04, + + 1597.21, + 731.04, + + 1674.27, + 528.23 + ] + ], + "iscrowd": 0, + "area": 69330.06809999999, + "image_id": 5588064, + "bbox": [ + 1597.21, + 528.23, + 256.01, + 270.80999999999995 + ], + "category_id": 15, + "id": 38917020 + }, + { + "segmentation": [ + [ + 1474.3300000000002, + 1165.54, + 1473.8187624307873, + 1155.1335202112105, + 1472.289973220411, + 1144.8272605115476, + 1469.7583554446887, + 1134.7204758158937, + 1466.2482899667234, + 1124.9104999857984, + 1461.793580635865, + 1115.4918084511837, + 1456.4371287381614, + 1106.5551083603089, + 1450.2305198335218, + 1098.1864650203456, + 1443.2335269585758, + 1090.4664730414243, + 1435.5135349796544, + 1083.4694801664782, + 1427.1448916396912, + 1077.2628712618387, + 1418.2081915488163, + 1071.9064193641352, + 1408.7895000142016, + 1067.4517100332766, + 1398.9795241841064, + 1063.9416445553113, + 1388.8727394884525, + 1061.410026779589, + 1378.5664797887896, + 1059.8812375692128, + 1368.16, + 1059.37, + 1357.7535202112106, + 1059.8812375692128, + 1347.4472605115477, + 1061.410026779589, + 1337.3404758158938, + 1063.9416445553113, + 1327.5304999857985, + 1067.4517100332766, + 1318.1118084511838, + 1071.9064193641352, + 1309.175108360309, + 1077.2628712618387, + 1300.806465020346, + 1083.4694801664782, + 1293.0864730414244, + 1090.4664730414243, + 1286.0894801664783, + 1098.1864650203456, + 1279.8828712618388, + 1106.5551083603089, + 1274.5264193641353, + 1115.4918084511837, + 1270.0717100332768, + 1124.9104999857984, + 1266.5616445553114, + 1134.7204758158937, + 1264.0300267795892, + 1144.8272605115476, + 1262.501237569213, + 1155.1335202112105, + 1261.99, + 1165.54, + 1262.501237569213, + 1175.9464797887895, + 1264.0300267795892, + 1186.2527394884523, + 1266.5616445553114, + 1196.3595241841062, + 1270.0717100332768, + 1206.1695000142015, + 1274.526419364135, + 1215.5881915488162, + 1279.8828712618388, + 1224.524891639691, + 1286.0894801664783, + 1232.893534979654, + 1293.0864730414244, + 1240.6135269585757, + 1300.8064650203457, + 1247.6105198335217, + 1309.175108360309, + 1253.8171287381613, + 1318.1118084511838, + 1259.1735806358647, + 1327.5304999857985, + 1263.6282899667233, + 1337.3404758158938, + 1267.1383554446886, + 1347.4472605115477, + 1269.6699732204108, + 1357.7535202112106, + 1271.1987624307872, + 1368.16, + 1271.71, + 1378.5664797887894, + 1271.1987624307872, + 1388.8727394884525, + 1269.6699732204108, + 1398.9795241841064, + 1267.1383554446886, + 1408.7895000142016, + 1263.6282899667233, + 1418.2081915488163, + 1259.1735806358647, + 1427.1448916396912, + 1253.8171287381613, + 1435.5135349796544, + 1247.6105198335217, + 1443.2335269585758, + 1240.6135269585757, + 1450.2305198335218, + 1232.8935349796543, + 1456.4371287381614, + 1224.524891639691, + 1461.7935806358648, + 1215.5881915488162, + 1466.2482899667234, + 1206.1695000142015, + 1469.7583554446887, + 1196.3595241841062, + 1472.289973220411, + 1186.2527394884523, + 1473.8187624307873, + 1175.9464797887895, + 1474.3300000000002, + 1165.54 + ] + ], + "iscrowd": 0, + "area": 45088.27560000006, + "image_id": 5588064, + "bbox": [ + 1261.99, + 1059.37, + 212.34000000000015, + 212.34000000000015 + ], + "category_id": 15, + "id": 38917021 + }, + { + "segmentation": [ + [ + 957.16, + 1368.35, + + 731.11, + 1465.91, + + 623.23, + 1327.28 + ] + ], + "iscrowd": 0, + "area": 46292.71590000003, + "image_id": 5588064, + "bbox": [ + 623.23, + 1327.28, + 333.92999999999995, + 138.6300000000001 + ], + "category_id": 15, + "id": 38917022 + }, + { + "segmentation": [ + [ + 2030.9, + 1060.28, + 1707.24, + 1304.17, + 2038.6, + 1478.75, + 2303.18, + 1268.23, + 2277.5, + 944.75, + 2107.96, + 862.6, + 2030.9, + 1060.28 + ] + ], + "iscrowd": 0, + "area": 367188.43099999987, + "image_id": 5588064, + "bbox": [ + 1707.24, + 862.6, + 595.9399999999998, + 616.15 + ], + "category_id": 15, + "id": 38917023 + } + ] +} \ No newline at end of file