Object area debugging and improvements (#16432)

* add ability to specify min and max area as percentages

* debug draw area and ratio

* docs

* update for best percentage
This commit is contained in:
Josh Hawkins
2025-02-09 14:48:23 -07:00
committed by GitHub
parent 83beacf84a
commit c8cec63cb9
8 changed files with 352 additions and 21 deletions
@@ -490,12 +490,27 @@ export default function ObjectLifecycle({
Area
</p>
{Array.isArray(item.data.box) &&
item.data.box.length >= 4
? Math.round(
detectArea *
(item.data.box[2] * item.data.box[3]),
)
: "N/A"}
item.data.box.length >= 4 ? (
<>
<div className="flex flex-col text-xs">
px:{" "}
{Math.round(
detectArea *
(item.data.box[2] * item.data.box[3]),
)}
</div>
<div className="flex flex-col text-xs">
%:{" "}
{(
(detectArea *
(item.data.box[2] * item.data.box[3])) /
detectArea
).toFixed(4)}
</div>
</>
) : (
"N/A"
)}
</div>
</div>
</div>