hafidhsoekma commited on
Commit
76dfa20
1 Parent(s): 886aa83

Update utils/configs.py

Browse files
Files changed (1) hide show
  1. utils/configs.py +253 -253
utils/configs.py CHANGED
@@ -1,253 +1,253 @@
1
- APP_NAME = "Final Projects"
2
- AUTHOR_NAME = "Hafidh Soekma Ardiansyah"
3
- EMAIL_NAME = "hafidhsoekma@gmail.com"
4
- UNIVERSITY_NAME = "Surabaya State University"
5
- MAJOR_NAME = "Management Informatics"
6
- SEMESTER_GRADE_NAME = "Semester 8"
7
- RESIDENCE_NAME = "Pasuruan, East Java, Indonesia"
8
- LINKEDIN_NAME = "https://www.linkedin.com/in/hafidhsoekma/"
9
- GITHUB_NAME = "https://www.github.com/hafidh561"
10
- LINKTREE_NAME = "https://linktr.ee/hafidhsoekma"
11
- ABOUT_ME = "I am an AI Engineer with 2+ years of experience in developing computer vision apps using PyTorch and TensorFlow. Skilled in Python and libraries such as NumPy, Pandas, Scikit-Learn, OpenCV, and more. Also familiar with NLP, reinforcement learning, optimization, and backend API apps. Currently focused on computer vision app development but am open to projects or works with my other familiar skills."
12
-
13
- EMBEDDED_VALUES_PATH = "./weights/prototypical_networks/"
14
- WEIGHTS_PATH = "./weights/deep_learning/"
15
- DEFAULT_IMAGES_PATH = "./assets/example_images"
16
- CLASS_CHARACTERS = (
17
- "gon",
18
- "hisoka",
19
- "killua",
20
- "kurapika",
21
- "leorio",
22
- "not hunter x hunter character",
23
- )
24
- SUPPORT_SET_METHODS = ("1_shot", "3_shot", "5_shot")
25
- NAME_MODELS = {
26
- "resnet50": {
27
- "image_similarity_threshold": 0.13558146433954904,
28
- "deep_learning_out_of_distribution_threshold": {
29
- SUPPORT_SET_METHODS[0]: 0.9850751426856094,
30
- SUPPORT_SET_METHODS[1]: 0.978944060038107,
31
- SUPPORT_SET_METHODS[2]: 0.988441473541884,
32
- },
33
- },
34
- "vgg16": {
35
- "image_similarity_threshold": 0.026766999256468353,
36
- "deep_learning_out_of_distribution_threshold": {
37
- SUPPORT_SET_METHODS[0]: 0.8536164277651976,
38
- SUPPORT_SET_METHODS[1]: 0.35677140466654966,
39
- SUPPORT_SET_METHODS[2]: 0.007097883451058687,
40
- },
41
- },
42
- "inception_v4": {
43
- "image_similarity_threshold": 0.037244822833773165,
44
- "deep_learning_out_of_distribution_threshold": {
45
- SUPPORT_SET_METHODS[0]: 0.92820986831184589,
46
- SUPPORT_SET_METHODS[1]: 0.9020234394459585,
47
- SUPPORT_SET_METHODS[2]: 0.7220187629430316,
48
- },
49
- },
50
- "efficientnet_b4": {
51
- "image_similarity_threshold": 0.17555058685090788,
52
- "deep_learning_out_of_distribution_threshold": {
53
- SUPPORT_SET_METHODS[0]: 0.9271371810463894,
54
- SUPPORT_SET_METHODS[1]: 0.5318528053369291,
55
- SUPPORT_SET_METHODS[2]: 0.8064065524435863,
56
- },
57
- },
58
- "mobilenetv3_large_100": {
59
- "image_similarity_threshold": 0.047335305338748856,
60
- "deep_learning_out_of_distribution_threshold": {
61
- SUPPORT_SET_METHODS[0]: 0.9491289555024716,
62
- SUPPORT_SET_METHODS[1]: 0.9586538707971848,
63
- SUPPORT_SET_METHODS[2]: 0.9010685291948485,
64
- },
65
- },
66
- "densenet121": {
67
- "image_similarity_threshold": 0.03336132699569965,
68
- "deep_learning_out_of_distribution_threshold": {
69
- SUPPORT_SET_METHODS[0]: 0.9049037713033348,
70
- SUPPORT_SET_METHODS[1]: 0.8722439933380164,
71
- SUPPORT_SET_METHODS[2]: 0.9002663720514151,
72
- },
73
- },
74
- "vit_base_patch16_224_dino": {
75
- "image_similarity_threshold": 0.015265149081440561,
76
- "deep_learning_out_of_distribution_threshold": {
77
- SUPPORT_SET_METHODS[0]: 0.010456596584911406,
78
- SUPPORT_SET_METHODS[1]: 0.007849406492441056,
79
- SUPPORT_SET_METHODS[2]: 0.008647647946935675,
80
- },
81
- },
82
- "clip": {
83
- "image_similarity_threshold": 0.11639473049489533,
84
- "deep_learning_out_of_distribution_threshold": {
85
- SUPPORT_SET_METHODS[0]: 0.961816022991822,
86
- SUPPORT_SET_METHODS[1]: 0.9802108045423086,
87
- SUPPORT_SET_METHODS[2]: 0.9255655260002051,
88
- },
89
- },
90
- }
91
- CLIP_NAME_MODEL = "openai/clip-vit-base-patch16"
92
- SIZE_IMAGES = 224
93
- RANDOM_SEED = 3407
94
- NORMALIZE_IMAGE_MEAN = (0.485, 0.456, 0.406)
95
- NORMALIZE_IMAGE_STD = (0.229, 0.224, 0.225)
96
- LIST_DEFAULT_CLASSES_FOR_ZERO_SHOT = {
97
- "Indonesian Hero": (
98
- "Soekarno",
99
- "Mohammad Hatta",
100
- "R.A. Kartini",
101
- "Ki Hajar Dewantara",
102
- "Tjut Njak Dien",
103
- "I Gusti Ngurah Rai",
104
- "Sultan Hasanuddin",
105
- "Pattimura",
106
- "Diponegoro",
107
- "Cut Nyak Dien",
108
- "Teuku Umar",
109
- "Tuanku Imam Bonjol",
110
- "Kapitan Pattimura",
111
- "Untung Suropati",
112
- "Supriyadi",
113
- "Raden Ajeng Kartini",
114
- "Raden Said Soekanto Tjokrodiatmodjo",
115
- "Not Indonesian Hero",
116
- ),
117
- "Indonesian Puppet": (
118
- "Semar",
119
- "Gareng",
120
- "Petruk",
121
- "Bagong",
122
- "Togog",
123
- "Cepot",
124
- "Dawala",
125
- "Bismania",
126
- "Merdi",
127
- "Barong",
128
- "Kethek",
129
- "Keris Tumpul",
130
- "Panji",
131
- "Gunungan",
132
- "Not Indonesian Puppet",
133
- ),
134
- "Indonesian President": (
135
- "Soekarno",
136
- "Soeharto",
137
- "B.J. Habibie",
138
- "Abdurrahman Wahid",
139
- "Megawati Sukarnoputri",
140
- "Susilo Bambang Yudhoyono",
141
- "Joko Widodo",
142
- "Not Indonesian President",
143
- ),
144
- "Indonesian Politician": (
145
- "Joko Widodo",
146
- "Prabowo Subianto",
147
- "Megawati Soekarnoputri",
148
- "Susilo Bambang Yudhoyono",
149
- "Agus Harimurti Yudhoyono",
150
- "Anies Baswedan",
151
- "Ridwan Kamil",
152
- "Sandiaga Uno",
153
- "Basuki Tjahaja Purnama",
154
- "Siti Nurbaya Bakar",
155
- "Siti Fadilah Supari",
156
- "Bambang Brodjonegoro",
157
- "Rizal Ramli",
158
- "Sri Mulyani Indrawati",
159
- "Mahfud MD",
160
- "Yusril Ihza Mahendra",
161
- "Aburizal Bakrie",
162
- "Jusuf Kalla",
163
- "Amien Rais",
164
- "Gatot Nurmantyo",
165
- "Wiranto",
166
- "Agum Gumelar",
167
- "Hatta Rajasa",
168
- "Luhut Binsar Pandjaitan",
169
- "Teten Masduki",
170
- "Muhaimin Iskandar",
171
- "Mardani Ali Sera",
172
- "Fadli Zon",
173
- "Ahok",
174
- "Not Indonesian Politician",
175
- ),
176
- "Indonesian Food": (
177
- "Nasi Goreng",
178
- "Sate",
179
- "Rendang",
180
- "Gado-Gado",
181
- "Bakso",
182
- "Nasi Uduk",
183
- "Soto",
184
- "Mie Goreng",
185
- "Ayam Goreng",
186
- "Nasi Kuning",
187
- "Nasi Padang",
188
- "Gudeg",
189
- "Rawon",
190
- "Lontong Cap Go Meh",
191
- "Martabak",
192
- "Pempek",
193
- "Ketoprak",
194
- "Nasi Liwet",
195
- "Babi Guling",
196
- "Pisang Goreng",
197
- "Not Indonesian Food",
198
- ),
199
- "Indonesian Temple": (
200
- "Borobudur",
201
- "Prambanan",
202
- "Candi Mendut",
203
- "Candi Sewu",
204
- "Candi Plaosan",
205
- "Candi Kalasan",
206
- "Candi Sari",
207
- "Candi Gebang",
208
- "Candi Banyunibo",
209
- "Candi Ratubaka",
210
- "Candi Sukuh",
211
- "Candi Jawi",
212
- "Candi Kidal",
213
- "Candi Penataran",
214
- "Not Indonesian Temple",
215
- ),
216
- "Indonesian Traditional Dress": (
217
- "Kebaya",
218
- "Batik",
219
- "Songket",
220
- "Ulos",
221
- "Sarong",
222
- "Sasirangan",
223
- "Tenun",
224
- "Palembang Songket",
225
- "Tapis",
226
- "Baju Kurung",
227
- "Baju Bodo",
228
- "Ikat",
229
- "Baju Kebaya Kutu Baru",
230
- "Beskap",
231
- "Baju Bali",
232
- "Blangkon",
233
- "Not Indonesian Traditional Dress",
234
- ),
235
- "Indonesian Traditional Musical Instrument": (
236
- "Angklung",
237
- "Gamelan",
238
- "Kendang",
239
- "Suling",
240
- "Rebana",
241
- "Serunai",
242
- "Gendang beleq",
243
- "Kolintang",
244
- "Arumba",
245
- "Talempong",
246
- "Sasando",
247
- "Saluang",
248
- "Gong",
249
- "Bonang",
250
- "Kompang",
251
- "Not Indonesian Traditional Musical Instrument",
252
- ),
253
- }
 
1
+ APP_NAME = "Final Projects"
2
+ AUTHOR_NAME = "Hafidh Soekma Ardiansyah"
3
+ EMAIL_NAME = "hafidhsoekma@gmail.com"
4
+ UNIVERSITY_NAME = "Surabaya State University"
5
+ MAJOR_NAME = "Management Informatics"
6
+ SEMESTER_GRADE_NAME = "Semester 8"
7
+ RESIDENCE_NAME = "Pasuruan, East Java, Indonesia"
8
+ LINKEDIN_NAME = "https://www.linkedin.com/in/hafidhsoekma/"
9
+ GITHUB_NAME = "https://www.github.com/hafidh561"
10
+ LINKTREE_NAME = "https://linktr.ee/hafidhsoekma"
11
+ ABOUT_ME = "I am an AI Engineer with 2+ years of experience in developing computer vision apps using PyTorch and TensorFlow. Skilled in Python and libraries such as NumPy, Pandas, Scikit-Learn, OpenCV, and more. Also familiar with NLP, reinforcement learning, optimization, and backend API apps. Currently focused on computer vision app development but am open to projects or works with my other familiar skills."
12
+
13
+ EMBEDDED_VALUES_PATH = "./weights/prototypical_networks/"
14
+ WEIGHTS_PATH = "./weights/deep_learning/"
15
+ DEFAULT_IMAGES_PATH = "./assets/example_images"
16
+ CLASS_CHARACTERS = (
17
+ "gon",
18
+ "hisoka",
19
+ "killua",
20
+ "kurapika",
21
+ "leorio",
22
+ "not hunter x hunter character",
23
+ )
24
+ SUPPORT_SET_METHODS = ("1_shot", "3_shot", "5_shot")
25
+ NAME_MODELS = {
26
+ "clip": {
27
+ "image_similarity_threshold": 0.11639473049489533,
28
+ "deep_learning_out_of_distribution_threshold": {
29
+ SUPPORT_SET_METHODS[0]: 0.961816022991822,
30
+ SUPPORT_SET_METHODS[1]: 0.9802108045423086,
31
+ SUPPORT_SET_METHODS[2]: 0.9255655260002051,
32
+ },
33
+ },
34
+ "vit_base_patch16_224_dino": {
35
+ "image_similarity_threshold": 0.015265149081440561,
36
+ "deep_learning_out_of_distribution_threshold": {
37
+ SUPPORT_SET_METHODS[0]: 0.010456596584911406,
38
+ SUPPORT_SET_METHODS[1]: 0.007849406492441056,
39
+ SUPPORT_SET_METHODS[2]: 0.008647647946935675,
40
+ },
41
+ },
42
+ "resnet50": {
43
+ "image_similarity_threshold": 0.13558146433954904,
44
+ "deep_learning_out_of_distribution_threshold": {
45
+ SUPPORT_SET_METHODS[0]: 0.9850751426856094,
46
+ SUPPORT_SET_METHODS[1]: 0.978944060038107,
47
+ SUPPORT_SET_METHODS[2]: 0.988441473541884,
48
+ },
49
+ },
50
+ "vgg16": {
51
+ "image_similarity_threshold": 0.026766999256468353,
52
+ "deep_learning_out_of_distribution_threshold": {
53
+ SUPPORT_SET_METHODS[0]: 0.8536164277651976,
54
+ SUPPORT_SET_METHODS[1]: 0.35677140466654966,
55
+ SUPPORT_SET_METHODS[2]: 0.007097883451058687,
56
+ },
57
+ },
58
+ "inception_v4": {
59
+ "image_similarity_threshold": 0.037244822833773165,
60
+ "deep_learning_out_of_distribution_threshold": {
61
+ SUPPORT_SET_METHODS[0]: 0.92820986831184589,
62
+ SUPPORT_SET_METHODS[1]: 0.9020234394459585,
63
+ SUPPORT_SET_METHODS[2]: 0.7220187629430316,
64
+ },
65
+ },
66
+ "efficientnet_b4": {
67
+ "image_similarity_threshold": 0.17555058685090788,
68
+ "deep_learning_out_of_distribution_threshold": {
69
+ SUPPORT_SET_METHODS[0]: 0.9271371810463894,
70
+ SUPPORT_SET_METHODS[1]: 0.5318528053369291,
71
+ SUPPORT_SET_METHODS[2]: 0.8064065524435863,
72
+ },
73
+ },
74
+ "mobilenetv3_large_100": {
75
+ "image_similarity_threshold": 0.047335305338748856,
76
+ "deep_learning_out_of_distribution_threshold": {
77
+ SUPPORT_SET_METHODS[0]: 0.9491289555024716,
78
+ SUPPORT_SET_METHODS[1]: 0.9586538707971848,
79
+ SUPPORT_SET_METHODS[2]: 0.9010685291948485,
80
+ },
81
+ },
82
+ "densenet121": {
83
+ "image_similarity_threshold": 0.03336132699569965,
84
+ "deep_learning_out_of_distribution_threshold": {
85
+ SUPPORT_SET_METHODS[0]: 0.9049037713033348,
86
+ SUPPORT_SET_METHODS[1]: 0.8722439933380164,
87
+ SUPPORT_SET_METHODS[2]: 0.9002663720514151,
88
+ },
89
+ },
90
+ }
91
+ CLIP_NAME_MODEL = "openai/clip-vit-base-patch16"
92
+ SIZE_IMAGES = 224
93
+ RANDOM_SEED = 3407
94
+ NORMALIZE_IMAGE_MEAN = (0.485, 0.456, 0.406)
95
+ NORMALIZE_IMAGE_STD = (0.229, 0.224, 0.225)
96
+ LIST_DEFAULT_CLASSES_FOR_ZERO_SHOT = {
97
+ "Indonesian Hero": (
98
+ "Soekarno",
99
+ "Mohammad Hatta",
100
+ "R.A. Kartini",
101
+ "Ki Hajar Dewantara",
102
+ "Tjut Njak Dien",
103
+ "I Gusti Ngurah Rai",
104
+ "Sultan Hasanuddin",
105
+ "Pattimura",
106
+ "Diponegoro",
107
+ "Cut Nyak Dien",
108
+ "Teuku Umar",
109
+ "Tuanku Imam Bonjol",
110
+ "Kapitan Pattimura",
111
+ "Untung Suropati",
112
+ "Supriyadi",
113
+ "Raden Ajeng Kartini",
114
+ "Raden Said Soekanto Tjokrodiatmodjo",
115
+ "Not Indonesian Hero",
116
+ ),
117
+ "Indonesian Puppet": (
118
+ "Semar",
119
+ "Gareng",
120
+ "Petruk",
121
+ "Bagong",
122
+ "Togog",
123
+ "Cepot",
124
+ "Dawala",
125
+ "Bismania",
126
+ "Merdi",
127
+ "Barong",
128
+ "Kethek",
129
+ "Keris Tumpul",
130
+ "Panji",
131
+ "Gunungan",
132
+ "Not Indonesian Puppet",
133
+ ),
134
+ "Indonesian President": (
135
+ "Soekarno",
136
+ "Soeharto",
137
+ "B.J. Habibie",
138
+ "Abdurrahman Wahid",
139
+ "Megawati Sukarnoputri",
140
+ "Susilo Bambang Yudhoyono",
141
+ "Joko Widodo",
142
+ "Not Indonesian President",
143
+ ),
144
+ "Indonesian Politician": (
145
+ "Joko Widodo",
146
+ "Prabowo Subianto",
147
+ "Megawati Soekarnoputri",
148
+ "Susilo Bambang Yudhoyono",
149
+ "Agus Harimurti Yudhoyono",
150
+ "Anies Baswedan",
151
+ "Ridwan Kamil",
152
+ "Sandiaga Uno",
153
+ "Basuki Tjahaja Purnama",
154
+ "Siti Nurbaya Bakar",
155
+ "Siti Fadilah Supari",
156
+ "Bambang Brodjonegoro",
157
+ "Rizal Ramli",
158
+ "Sri Mulyani Indrawati",
159
+ "Mahfud MD",
160
+ "Yusril Ihza Mahendra",
161
+ "Aburizal Bakrie",
162
+ "Jusuf Kalla",
163
+ "Amien Rais",
164
+ "Gatot Nurmantyo",
165
+ "Wiranto",
166
+ "Agum Gumelar",
167
+ "Hatta Rajasa",
168
+ "Luhut Binsar Pandjaitan",
169
+ "Teten Masduki",
170
+ "Muhaimin Iskandar",
171
+ "Mardani Ali Sera",
172
+ "Fadli Zon",
173
+ "Ahok",
174
+ "Not Indonesian Politician",
175
+ ),
176
+ "Indonesian Food": (
177
+ "Nasi Goreng",
178
+ "Sate",
179
+ "Rendang",
180
+ "Gado-Gado",
181
+ "Bakso",
182
+ "Nasi Uduk",
183
+ "Soto",
184
+ "Mie Goreng",
185
+ "Ayam Goreng",
186
+ "Nasi Kuning",
187
+ "Nasi Padang",
188
+ "Gudeg",
189
+ "Rawon",
190
+ "Lontong Cap Go Meh",
191
+ "Martabak",
192
+ "Pempek",
193
+ "Ketoprak",
194
+ "Nasi Liwet",
195
+ "Babi Guling",
196
+ "Pisang Goreng",
197
+ "Not Indonesian Food",
198
+ ),
199
+ "Indonesian Temple": (
200
+ "Borobudur",
201
+ "Prambanan",
202
+ "Candi Mendut",
203
+ "Candi Sewu",
204
+ "Candi Plaosan",
205
+ "Candi Kalasan",
206
+ "Candi Sari",
207
+ "Candi Gebang",
208
+ "Candi Banyunibo",
209
+ "Candi Ratubaka",
210
+ "Candi Sukuh",
211
+ "Candi Jawi",
212
+ "Candi Kidal",
213
+ "Candi Penataran",
214
+ "Not Indonesian Temple",
215
+ ),
216
+ "Indonesian Traditional Dress": (
217
+ "Kebaya",
218
+ "Batik",
219
+ "Songket",
220
+ "Ulos",
221
+ "Sarong",
222
+ "Sasirangan",
223
+ "Tenun",
224
+ "Palembang Songket",
225
+ "Tapis",
226
+ "Baju Kurung",
227
+ "Baju Bodo",
228
+ "Ikat",
229
+ "Baju Kebaya Kutu Baru",
230
+ "Beskap",
231
+ "Baju Bali",
232
+ "Blangkon",
233
+ "Not Indonesian Traditional Dress",
234
+ ),
235
+ "Indonesian Traditional Musical Instrument": (
236
+ "Angklung",
237
+ "Gamelan",
238
+ "Kendang",
239
+ "Suling",
240
+ "Rebana",
241
+ "Serunai",
242
+ "Gendang beleq",
243
+ "Kolintang",
244
+ "Arumba",
245
+ "Talempong",
246
+ "Sasando",
247
+ "Saluang",
248
+ "Gong",
249
+ "Bonang",
250
+ "Kompang",
251
+ "Not Indonesian Traditional Musical Instrument",
252
+ ),
253
+ }