From aa0bccd9c8967049bdecfb9597be44b52fa59d71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Jun 2023 22:18:01 +0000 Subject: [PATCH 1/5] Bump pipreqs from 0.4.11 to 0.4.12 Bumps [pipreqs](https://github.com/bndr/pipreqs) from 0.4.11 to 0.4.12. - [Release notes](https://github.com/bndr/pipreqs/releases) - [Changelog](https://github.com/bndr/pipreqs/blob/master/HISTORY.rst) - [Commits](https://github.com/bndr/pipreqs/compare/v0.4.11...v0.4.12) --- updated-dependencies: - dependency-name: pipreqs dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2211015..ecdfe6e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ docopt==0.6.2 idna==3.4 numpy==1.24.2 Pillow==9.4.0 -pipreqs==0.4.11 +pipreqs==0.4.12 requests==2.28.2 sqlparse==0.4.4 urllib3==1.26.15 From a355889892d7766cacee0cb98551e50104e62223 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jul 2023 00:04:25 +0000 Subject: [PATCH 2/5] Bump django from 4.1.7 to 4.1.10 Bumps [django](https://github.com/django/django) from 4.1.7 to 4.1.10. - [Commits](https://github.com/django/django/compare/4.1.7...4.1.10) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2211015..fbe0e36 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ asgiref==3.6.0 certifi==2022.12.7 charset-normalizer==3.1.0 -Django==4.1.7 +Django==4.1.10 docopt==0.6.2 idna==3.4 numpy==1.24.2 From 0c5450238c56b7786123b36aff38ae47bd5fbb4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jul 2023 21:22:49 +0000 Subject: [PATCH 3/5] Bump certifi from 2022.12.7 to 2023.7.22 Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.12.7 to 2023.7.22. - [Commits](https://github.com/certifi/python-certifi/compare/2022.12.07...2023.07.22) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2211015..5fd24e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ asgiref==3.6.0 -certifi==2022.12.7 +certifi==2023.7.22 charset-normalizer==3.1.0 Django==4.1.7 docopt==0.6.2 From f5cdcf78244ce33f816a2ccf5adf056c0f454e58 Mon Sep 17 00:00:00 2001 From: Jens Dede Date: Thu, 10 Aug 2023 13:35:40 +0200 Subject: [PATCH 4/5] Use betavariate to prefer polling on images with fewer polls --- simplelabel/views.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/simplelabel/views.py b/simplelabel/views.py index e89af02..cdf57e5 100644 --- a/simplelabel/views.py +++ b/simplelabel/views.py @@ -170,10 +170,24 @@ class PollImageView(FormView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - pks = Image.objects.filter(image_dataset__dataset_active=True).values_list('pk', flat=True) - if len(pks) == 0: - raise Http404("No polls available yet. Please return later") - random_pk = random.choice(pks) + use_betavariate = True + random_pk = None + + if use_betavariate: + pks = Image.objects.filter(image_dataset__dataset_active=True).annotate(num_polls=Count("poll")).order_by("num_polls").values_list('pk', flat=True) + if len(pks) == 0: + raise Http404("No polls available yet. Please return later") + # TODO: Maybe check the parameters. Should be a uniform + # distribution with a slightly higher probability towards low + # values (i.e. images with less polls). + random_pk = pks[round(random.betavariate(0.8, 1) * (len(pks)-1))] + else: + pks = Image.objects.filter(image_dataset__dataset_active=True).values_list('pk', flat=True) + if len(pks) == 0: + raise Http404("No polls available yet. Please return later") + random_pk = random.choice(pks) + + random_img = Image.objects.get(pk=random_pk) classes = Class.objects.filter(class_is_visible=True) From 39f0fd4057dd312a23b8f7110dd59f12e1b3582a Mon Sep 17 00:00:00 2001 From: Jens Dede Date: Thu, 10 Aug 2023 13:37:20 +0200 Subject: [PATCH 5/5] Add pillow as dependency --- tools/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/README.md b/tools/README.md index 7c1f566..5b9fc4e 100644 --- a/tools/README.md +++ b/tools/README.md @@ -15,7 +15,6 @@ to an `.mp4` file: - Required libraries (venv) ========================= @@ -25,6 +24,7 @@ a virtual environment (venv) using pip: * imutils * numpy * opencv-python +* Pillow Tools and their use cases