From: Francois Fleuret Date: Wed, 27 Jul 2022 04:56:40 +0000 (+0200) Subject: Compute both the average number of requested and obtained properties. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=a238fb780003e847d388861c41f0facdc5738dd0;p=mygpt.git Compute both the average number of requested and obtained properties. --- diff --git a/main.py b/main.py index 82caebe..6592204 100755 --- 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}') ######################################################################