Hsyshasuzh/longmemory-geo / project /tests /test_phase2_tile_records.py
Hsyshasuzh's picture
download
raw
1.07 kB
import unittest
from evaluation.phase2_tile_records import capture_tile
class TileRecordTests(unittest.TestCase):
def test_retains_mapped_and_unmapped_predictions_in_source_coordinates(self):
tile = capture_tile(
100, 200, 1024, 1024,
[[[1, 2], [3, 2], [3, 4], [1, 4]],
[[5, 6], [7, 6], [7, 8], [5, 8]]],
[4, 1], [0.8, 0.3], {4: 4},
)
self.assertEqual(tile['origin'], [100, 200])
self.assertEqual(len(tile['predictions']), 2)
self.assertEqual(tile['predictions'][0]['obb_polygon'],
[101.0, 202.0, 103.0, 202.0, 103.0, 204.0, 101.0, 204.0])
self.assertEqual(tile['predictions'][0]['category_id'], 4)
self.assertIsNone(tile['predictions'][1]['category_id'])
self.assertEqual(tile['predictions'][1]['source_class_id'], 1)
def test_rejects_mismatched_output_lengths(self):
with self.assertRaises(ValueError):
capture_tile(0, 0, 1024, 1024, [], [1], [], {})
if __name__ == '__main__':
unittest.main()

Xet Storage Details

Size:
1.07 kB
·
Xet hash:
1d6b0894b75fc3c7cc44827a9475ee74de2771ff257faa2462fbe28188629859

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.