achterbrain commited on
Commit
e4fefa7
1 Parent(s): 748cc87

added actual asessment algorithms

Browse files
pages/2_🤖Automated assessment.py CHANGED
@@ -2,29 +2,20 @@ import streamlit as st
2
  import numpy as np
3
  from itertools import compress
4
  from PIL import Image
5
- #from pages.Functions.Assessment_functions import Empty_DSwrapper
6
 
7
- @st.cache
8
- def Empty_DSwrapper(img, representations = None, Task_specific_label = None):
9
- '''
10
- Dashboard wrapper of DETR_multi_object_counting
11
- '''
12
- img_input = img
13
-
14
- return True
15
 
16
  # Create dictionary to hold functions
17
  fun_dict = {
18
- 'Multiple object types':Empty_DSwrapper,
19
- 'Single object':Empty_DSwrapper,
20
- 'Negation':Empty_DSwrapper}
21
 
22
 
23
  st.title('Automated Assessment')
24
  st.write('On this page you can use automated assessment algorithms to assess how good uploaded images match their respective prompts.')
25
  st.write(' ')
26
- side_image = Image.open('Graphics/IL_Logo.png')
27
- st.sidebar.image(side_image)
28
 
29
  try:
30
  # Create necessary variables
 
2
  import numpy as np
3
  from itertools import compress
4
  from PIL import Image
5
+ from pages.Functions.Assessment_functions import CLIP_single_object_classifier, CLIP_multi_object_recognition_DSwrapper, CLIP_object_negation
6
 
 
 
 
 
 
 
 
 
7
 
8
  # Create dictionary to hold functions
9
  fun_dict = {
10
+ 'Multiple object types':CLIP_multi_object_recognition_DSwrapper,
11
+ 'Single object':CLIP_single_object_classifier,
12
+ 'Negation':CLIP_object_negation}
13
 
14
 
15
  st.title('Automated Assessment')
16
  st.write('On this page you can use automated assessment algorithms to assess how good uploaded images match their respective prompts.')
17
  st.write(' ')
18
+ st.sidebar.image('Graphics/IL_Logo.png')
 
19
 
20
  try:
21
  # Create necessary variables
pages/Functions/Assessment_functions.py CHANGED
@@ -19,17 +19,6 @@ coco_objects = coco_objects.split("\n")
19
  #test_image = Image.open('pages/Functions/test_image.png')
20
  #test_image = Image.open('pages/Functions/test_imageIV.png')
21
 
22
- ###### Empty function for debugging
23
-
24
- def Empty_DSwrapper(img, representations = None, Task_specific_label = None):
25
- '''
26
- Dashboard wrapper of DETR_multi_object_counting
27
- '''
28
- img_input = img
29
-
30
- return True
31
-
32
-
33
  ###### Helper functions
34
  def Coco_object_set(included_object, set_length=6):
35
  '''
 
19
  #test_image = Image.open('pages/Functions/test_image.png')
20
  #test_image = Image.open('pages/Functions/test_imageIV.png')
21
 
 
 
 
 
 
 
 
 
 
 
 
22
  ###### Helper functions
23
  def Coco_object_set(included_object, set_length=6):
24
  '''