| 428 | } // namespace detail |
| 429 | |
| 430 | void CocoLoader::SavePreprocessedAnnotations( |
| 431 | const std::string &path, const std::vector<FileLabelEntry> &entries) { |
| 432 | using detail::SaveToFile; |
| 433 | SaveToFile(offsets_, path + "/offsets.dat"); |
| 434 | SaveToFile(boxes_, path + "/boxes.dat"); |
| 435 | SaveToFile(labels_, path + "/labels.dat"); |
| 436 | SaveToFile(counts_, path + "/counts.dat"); |
| 437 | SaveToFile(entries, path + "/filenames.dat"); |
| 438 | |
| 439 | if (output_polygon_masks_ || output_pixelwise_masks_) { |
| 440 | SaveToFile(polygon_data_, path + "/polygon_data.dat"); |
| 441 | SaveToFile(polygon_offset_, path + "/polygon_offset.dat"); |
| 442 | SaveToFile(polygon_count_, path + "/polygons_count.dat"); |
| 443 | SaveToFile(vertices_data_, path + "/vertices.dat"); |
| 444 | SaveToFile(vertices_offset_, path + "/vertices_offset.dat"); |
| 445 | SaveToFile(vertices_count_, path + "/vertices_count.dat"); |
| 446 | } |
| 447 | |
| 448 | if (output_pixelwise_masks_) { |
| 449 | SaveToFile(masks_rles_, path + "/masks_rles.dat"); |
| 450 | SaveToFile(masks_rles_idx_, path + "/masks_rles_idx.dat"); |
| 451 | SaveToFile(mask_offsets_, path + "/masks_offset.dat"); |
| 452 | SaveToFile(mask_counts_, path + "/mask_count.dat"); |
| 453 | SaveToFile(heights_, path + "/heights.dat"); |
| 454 | SaveToFile(widths_, path + "/widths.dat"); |
| 455 | } |
| 456 | |
| 457 | if (output_image_ids_) { |
| 458 | SaveToFile(original_ids_, path + "/original_ids.dat"); |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | void CocoLoader::ParsePreprocessedAnnotations() { |
| 463 | assert(HasPreprocessedAnnotations(spec_)); |
nothing calls this directly
no test coverage detected