Skip to content

Commit

Permalink
fix: don't convert to int (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDarmon authored Nov 29, 2023
2 parents bc045ca + bc0f306 commit 6fc38f9
Show file tree
Hide file tree
Showing 7 changed files with 1,577 additions and 1,577 deletions.
3,140 changes: 1,570 additions & 1,570 deletions tests/assets/integration_tests/expected_outputs/corrected_tracks.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"object_id": 1.0, "state": 0, "re_id_chain": [1.0, 33.0], "metadata": {"first_frame_id": 1, "last_frame_id": 363, "class_counts": {"0": 313}, "bbox": [729, 88, 888, 251], "confidence": 0.818931, "confidence_sum": 245.7679709999999, "observations": 313}}
{"object_id": 1.0, "state": 0, "re_id_chain": [1.0, 33.0], "metadata": {"first_frame_id": 1, "last_frame_id": 363, "class_counts": {"0": 313}, "bbox": [729.01115, 88.351507, 888.994179, 251.338684], "confidence": 0.818931, "confidence_sum": 245.7679709999999, "observations": 313}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"object_id": 2.0, "state": 0, "re_id_chain": [2.0, 6.0, 10.0, 16.0], "metadata": {"first_frame_id": 1, "last_frame_id": 363, "class_counts": {"0": 320}, "bbox": [596, 100, 714, 218], "confidence": 0.631255, "confidence_sum": 224.94876499999998, "observations": 320}}
{"object_id": 2.0, "state": 0, "re_id_chain": [2.0, 6.0, 10.0, 16.0], "metadata": {"first_frame_id": 1, "last_frame_id": 363, "class_counts": {"0": 320}, "bbox": [596.89506, 100.004586, 714.968154, 218.135985], "confidence": 0.631255, "confidence_sum": 224.94876499999998, "observations": 320}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"object_id": 3.0, "state": 0, "re_id_chain": [3.0, 38.0, 41.0, 45.0], "metadata": {"first_frame_id": 1, "last_frame_id": 363, "class_counts": {"0": 314}, "bbox": [529, 471, 715, 605], "confidence": 0.756379, "confidence_sum": 229.919842, "observations": 314}}
{"object_id": 3.0, "state": 0, "re_id_chain": [3.0, 38.0, 41.0, 45.0], "metadata": {"first_frame_id": 1, "last_frame_id": 363, "class_counts": {"0": 314}, "bbox": [529.799016, 471.98941, 715.100145, 605.343521], "confidence": 0.756379, "confidence_sum": 229.919842, "observations": 314}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"object_id": 4.0, "state": 0, "re_id_chain": [4.0, 43.0], "metadata": {"first_frame_id": 1, "last_frame_id": 363, "class_counts": {"0": 349}, "bbox": [464, 187, 886, 562], "confidence": 0.575016, "confidence_sum": 260.3729819999998, "observations": 349}}
{"object_id": 4.0, "state": 0, "re_id_chain": [4.0, 43.0], "metadata": {"first_frame_id": 1, "last_frame_id": 363, "class_counts": {"0": 349}, "bbox": [464.340096, 187.235206, 886.764957, 562.191421], "confidence": 0.575016, "confidence_sum": 260.3729819999998, "observations": 349}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"object_id": 5.0, "state": 1, "re_id_chain": [5.0, 17.0, 21.0, 23.0, 27.0], "metadata": {"first_frame_id": 1, "last_frame_id": 323, "class_counts": {"0": 422}, "bbox": [584, 260, 710, 477], "confidence": 0.728422, "confidence_sum": 322.0736030000005, "observations": 422}}
{"object_id": 5.0, "state": 1, "re_id_chain": [5.0, 17.0, 21.0, 23.0, 27.0], "metadata": {"first_frame_id": 1, "last_frame_id": 323, "class_counts": {"0": 422}, "bbox": [584.114759, 260.483516, 710.983494, 477.370646], "confidence": 0.728422, "confidence_sum": 322.0736030000005, "observations": 422}}
4 changes: 2 additions & 2 deletions trackreid/tracked_object_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def update(self, data_line: np.ndarray, frame_id: int):

class_name = int(data_line[input_data_positions.category])
self.class_counts[class_name] = self.class_counts.get(class_name, 0) + 1
self.bbox = list(map(int, data_line[input_data_positions.bbox]))
self.bbox = list(data_line[input_data_positions.bbox])
confidence = float(data_line[input_data_positions.confidence])
self.confidence = confidence
self.confidence_sum += confidence
Expand Down Expand Up @@ -126,7 +126,7 @@ def to_dict(self):
"first_frame_id": int(self.first_frame_id),
"last_frame_id": int(self.last_frame_id),
"class_counts": class_counts_str,
"bbox": [int(i) for i in self.bbox],
"bbox": self.bbox,
"confidence": float(self.confidence),
"confidence_sum": float(self.confidence_sum),
"observations": int(self.observations),
Expand Down

0 comments on commit 6fc38f9

Please sign in to comment.