Compute both the average number of requested and obtained properties.
authorFrancois Fleuret <francois@fleuret.org>
Wed, 27 Jul 2022 04:56:40 +0000 (06:56 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Wed, 27 Jul 2022 04:56:40 +0000 (06:56 +0200)
main.py

diff --git a/main.py b/main.py
index 82caebe..6592204 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -254,14 +254,14 @@ class TaskPicoCLVR(Task):
         )
         log_string(f'wrote {image_name}')
 
-        nb_missing = sum( [
-            x[2] for x in picoclvr.nb_missing_properties(
-                descr,
-                height = self.height, width = self.width
-            )
-        )
+        np = picoclvr.nb_properties(
+            descr,
+            height = self.height, width = self.width
+        )
+
+        nb_requested_properties, _, nb_missing_properties = zip(*np)
 
-        log_string(f'nb_missing {nb_missing / len(descr):.02f}')
+        log_string(f'nb_requested_properties {sum(nb_requested_properties) / len(descr):.02f} nb_missing_properties {sum(nb_missing_properties) / len(descr):.02f}')
 
 ######################################################################