From 5fbb23cf8dc772ab53fde445c4696429ff24c267 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Wed, 30 Oct 2024 08:11:28 +0100 Subject: [PATCH 01/11] initial seed --- .../gatheringScript/getUsers.py | 140 ++++++++++++ .../getImagesScript/getImages.py | 140 ++++++++++++ .../seedingScript/employees_v01.csv | 215 ++++++++++++++++++ .../seedingScript/removeUsers.ps1 | 20 ++ .../seedingScript/seedDatabase.py | 142 ++++++++++++ 5 files changed, 657 insertions(+) create mode 100644 src/scripts/migrate-watchlist-members/gatheringScript/getUsers.py create mode 100644 src/scripts/migrate-watchlist-members/getImagesScript/getImages.py create mode 100644 src/scripts/migrate-watchlist-members/seedingScript/employees_v01.csv create mode 100644 src/scripts/migrate-watchlist-members/seedingScript/removeUsers.ps1 create mode 100644 src/scripts/migrate-watchlist-members/seedingScript/seedDatabase.py diff --git a/src/scripts/migrate-watchlist-members/gatheringScript/getUsers.py b/src/scripts/migrate-watchlist-members/gatheringScript/getUsers.py new file mode 100644 index 0000000..4251fac --- /dev/null +++ b/src/scripts/migrate-watchlist-members/gatheringScript/getUsers.py @@ -0,0 +1,140 @@ +import requests +import os + +def rearrange_name(fullname): + # Split the full name into words + name_parts = fullname.split() + + # Check if the name has more than one word + if len(name_parts) > 1: + # Move the first word (assumed to be the surname) to the end + rearranged_name = " ".join(name_parts[1:] + [name_parts[0]]) + else: + # If there's only one word, return it as is + rearranged_name = fullname + + return rearranged_name + +def apply_curl_to_items(api_url, image_data_ids, save_to_folder): + print("Downloading images:") + #print(image_data_ids) + + for image_id, full_name, display_name in image_data_ids: + url = f"{api_url}/{image_id}" + headers = {"accept": "image/jpeg"} + + try: + response = requests.get(url, headers=headers) + + # Check if the request was successful (status code 200) + if response.status_code == 200: + # Save the image data to a file in the specified folder + file_name = full_name if full_name else display_name + file_path = os.path.join(save_to_folder, f"{file_name}_{image_id}.jpg") + with open(file_path, "wb") as file: + file.write(response.content) + print(f"Image saved: {file_path}") + else: + print(f"Failed to retrieve image with id: {image_id}, Status code: {response.status_code}") + + except requests.exceptions.RequestException as e: + print(f"An error occurred while processing image with id: {image_id}, Error: {e}") + + +if __name__ == '__main__': + api_url = 'http://10.11.64.18:8098/api/v1/Images' # Replace with the actual API endpoint for image retrieval + save_to_folder = "./images/" + + # GraphQL endpoint URL + graphql_url = "http://10.11.64.18:8097/graphql/" + + # GraphQL query + query = """ + query($skip: Int!, $take: Int!) + { + watchlistMembers( + where: {watchlists: {all: {id: {eq: "innovatrics"}}}}, + skip:$skip, + take:$take + ) { + items { + displayName + fullName + tracklet { + faces(where: {faceType: {eq: REGULAR}}) { + imageDataId + faceType + } + } + } + totalCount + } + } + """ + + take = 100 # Number of items to fetch per request + skip = 0 # Starting point for each batch + has_more_data = True + all_data = [] + image_data_ids = [] # Initialize this at a higher scope so it can be used later + + # Set up headers for the request + headers = { + "Content-Type": "application/json", + } + + image_data_ids = [] + while has_more_data: + # Set up the variables for the GraphQL query + variables = { + "skip": skip, + "take": take + } + + try: + # Make the GraphQL request with variables + response = requests.post(graphql_url, json={"query": query, "variables": variables}, headers=headers) + response.raise_for_status() # Check for HTTP errors + data = response.json() + + if "errors" in data: + print(f"Error: {data['errors']}") + break + + # Update skip for the next batch + skip += take + + # Extract imageDataId values + + totalCount = data["data"]["watchlistMembers"]["totalCount"] + for item in data["data"]["watchlistMembers"]["items"]: + fullname = item["fullName"] + displayname = item["displayName"] + for faces in item["tracklet"]["faces"]: + # Check if watchlistMember is a string or a dictionary + facedata = faces["imageDataId"] + + if fullname is None and displayname is not None: + fullname = displayname + + fullname = rearrange_name(fullname) + + image_data_ids.append((facedata, fullname, displayname)) + print(facedata, fullname) + + # Check if we've fetched all items + if skip >= totalCount: + has_more_data = False + + except requests.exceptions.RequestException as e: + print("An error occurred:", e) + print("Response content:", response.content) + break + + #After fetching all the data, call apply_curl_to_items to download images + if image_data_ids: + try: + apply_curl_to_items(api_url, image_data_ids, save_to_folder) + except requests.exceptions.RequestException as e: + print("Error while downloading an image:", e) + print("Response content:", response.content) diff --git a/src/scripts/migrate-watchlist-members/getImagesScript/getImages.py b/src/scripts/migrate-watchlist-members/getImagesScript/getImages.py new file mode 100644 index 0000000..3b541f5 --- /dev/null +++ b/src/scripts/migrate-watchlist-members/getImagesScript/getImages.py @@ -0,0 +1,140 @@ +import requests +import os +import re # Make sure to import the re module for regular expressions + +def sanitize_filename(filename): + """Replace invalid characters in the filename.""" + return re.sub(r'[<>:"/\\|?*]', '_', filename) + +def apply_curl_to_items(api_url, image_data_ids, save_to_folder): + print("Downloading images:") + #print(image_data_ids) + + for image_id, full_name, display_name, createdAt in image_data_ids: + url = f"{api_url}/{image_id}" + headers = {"accept": "image/jpeg"} + + try: + response = requests.get(url, headers=headers) + + # Check if the request was successful (status code 200) + if response.status_code == 200: + + # Sanitize the createdAt timestamp + sanitized_createdAt = sanitize_filename(createdAt) + + # Save the image data to a file in the specified folder + file_name = full_name if full_name else display_name + file_path = os.path.join(save_to_folder, f"{sanitized_createdAt}_{file_name}_{image_id}.jpg") + with open(file_path, "wb") as file: + file.write(response.content) + print(f"Image saved: {file_path}") + else: + print(f"Failed to retrieve image with id: {image_id}, Status code: {response.status_code}") + + except requests.exceptions.RequestException as e: + print(f"An error occurred while processing image with id: {image_id}, Error: {e}") + + +if __name__ == '__main__': + api_url = 'http://192.168.101.10:8098/api/v1/Images' # Replace with the actual API endpoint for image retrieval + save_to_folder = "./images/" + + # GraphQL endpoint URL + graphql_url = "http://192.168.101.10:8097/graphql/" + + # GraphQL query + query = """ + query($skip: Int!, $take: Int!) + { + matchResults( + skip: $skip, take: $take, order: {createdAt: ASC}, + where: { + createdAt: {gte: "2024-09-25T09:00:00.000Z"} + } + ) + + { # Add skip and take here + items { + createdAt + watchlistMemberFullName + watchlistMemberDisplayName + faceId + frameId + faceOrder + age + gender + frame { + id + imageDataId + } + } + totalCount + pageInfo { + hasNextPage + hasPreviousPage + } + } + } + """ + + take = 100 # Number of items to fetch per request + skip = 0 # Starting point for each batch + has_more_data = True + all_data = [] + image_data_ids = [] # Initialize this at a higher scope so it can be used later + + # Set up headers for the request + headers = { + "Content-Type": "application/json", + } + + image_data_ids = [] + while has_more_data: + # Set up the variables for the GraphQL query + variables = { + "skip": skip, + "take": take + } + + try: + # Make the GraphQL request with variables + response = requests.post(graphql_url, json={"query": query, "variables": variables}, headers=headers) + response.raise_for_status() # Check for HTTP errors + data = response.json() + + if "errors" in data: + print(f"Error: {data['errors']}") + break + + # Update skip for the next batch + skip += take + + # Extract imageDataId values + + totalCount = data["data"]["matchResults"]["totalCount"] + for item in data["data"]["matchResults"]["items"]: + createdAt = item["createdAt"] + fullname = item["watchlistMemberFullName"] + displayname = item["watchlistMemberDisplayName"] + frameImageId = item["frame"]["imageDataId"] + image_data_ids.append((frameImageId, fullname, displayname, createdAt)) + + print(frameImageId, fullname, displayname, createdAt) + + # Check if we've fetched all items + if skip >= totalCount: + has_more_data = False + + except requests.exceptions.RequestException as e: + print("An error occurred:", e) + print("Response content:", response.content) + break + + #After fetching all the data, call apply_curl_to_items to download images + if image_data_ids: + try: + apply_curl_to_items(api_url, image_data_ids, save_to_folder) + except requests.exceptions.RequestException as e: + print("Error while downloading an image:", e) + print("Response content:", response.content) diff --git a/src/scripts/migrate-watchlist-members/seedingScript/employees_v01.csv b/src/scripts/migrate-watchlist-members/seedingScript/employees_v01.csv new file mode 100644 index 0000000..b5e11c6 --- /dev/null +++ b/src/scripts/migrate-watchlist-members/seedingScript/employees_v01.csv @@ -0,0 +1,215 @@ +Name,Years,"Last name, First name",Name and Surname,Images +Adam,0,"Furi, Adam",Adam Füri,Adam Füri_5330414e-4f38-4b77-ae00-ce2f8c29ddec.jpg +Adam,0,"Matyas, Adam",Adam Mátyás,Adam Mátyás_d679be1a-6033-411c-aa41-2359d1a3cb37.jpg +Adrián,8,"Fejes, Adrian",Adrián Fejes,Adrián Feješ_4ceaa4ee-ac1f-45ba-9c0a-9a5339a7f99a.jpg +Adriena,0,"Mozgayova, Adriena",Adriena Mozgayova,Adriena Mozgayová_67344f35-dd5f-4573-8551-d338ce810b69.jpg +Adriena,2,"Nemethova, Adriena",Adriena Némethová,Adriena Némethová_0be9755b-baee-40e8-b9c3-ad24ce9e6fbf.jpg +Ákos,0,"Levardy, Akos",Ákos Lévárdy,Akos Levardy_33db475f-596d-4f71-bdd4-f2dccb3957b1.jpg +Alejandro,5,"Aleman, Alejandro",Alejandro Alemán,Alejandro Alemán_a94890fb-5982-48ef-ac56-1ff9e662ccbf.jpg +Aleksandra,0,"Krstevska, Aleksandra",Aleksandra Krstevska,Krstevska Aleksandra_b5997997-249a-4e62-a5e9-55f96a6736ca.jpg +Alena,7,"Szentandrasi, Alena",Alena Szentandrási,Alena D-Szentandrási_d47b8fd8-de78-4b37-ba61-c264e04d88db.jpg +Alexandre,3,"Godoy, Alexandre",Alexandre Godoy,Alexandre Godoy_c5a42966-dac2-40a0-aa26-5a8f6b897da2.jpg +Alica,2,"Holla, Alica",Alica Hollá,Alica Hollá_9e57b5e6-f8bc-427a-8062-836dc24dff23.jpg +Andrea,5,"Karabova, Andrea",Andrea Karabová,Andrea Karabová_17ae0c30-a1c9-472c-be3e-c66839d7dd90.jpg +Andrea,2,"Korcokova, Andrea",Andrea Korčoková,Andrea Korčoková_0d16fbbf-461c-4491-8f33-47586381d1eb.jpg +Andrea,0,"Majanova, Andrea",Andrea Majanová,Andrea Majanová_e28f5070-ba3c-4d85-b948-11417a67218f.jpg +Andrei,0,"Oleinikov, Andrei",Andrei Oleinikov,Andrei Oleinikov_752ab0d2-fb63-4be0-94ee-c69c67174d5c.jpg +Andrej,6,"Kobercik, Andrej",Andrej Koberčík,Andrej Koberčík_2d00d053-9b44-48d2-bf9a-70ef8b4b4037.jpg +Andrej,5,"Toth, Andrej",Andrej Tóth,Andrej Tóth_2562f13d-77e4-4d2b-a8f2-2f1faaaa735c.jpg +Andrii,1,"Danilin, Andrii",Andrii Danilin,Andrii Danilin_6b0082c1-4573-4c44-99ff-ae85c43c5550.jpg +Anna,0,"Drahan, Anna",Anna Drahan,Anna Drahan_0dfcf80b-11ad-4f45-a9fc-1e7acbcd07a4.jpg +Anna,0,"Tkacova, Anna",Anna Tkáčová,Anna Tkáčová_c02806cc-d45e-4bac-aac5-3ab0182f265c.jpg +Attila,2,"Mucka, Attila",Attila Múčka,Attila Múčka_2b16806b-5c55-403a-a9c9-6a15b80194b7.jpg +Barbara,0,"Rybarova, Barbara",Barbara Rybárová,Barbara Rybárová_3c52565c-31b8-4f51-99da-9787a2429788.jpg +Barbora,0,"Barancova, Barbora",Barbora Barancová,Barbora Barancová_4b1cc5e3-f663-4924-85cc-b91274359b1e.jpg +Barbora,8,"Chabadova, Barbora",Barbora Chabadová,Barbora Chabadová_dd877820-2440-45d4-a4af-6f85c1089f5d.jpg +Barbora,2,"Horvat, Barbora",Barbora Horvat,Barbora Horvat_5d80b621-6181-4476-8eb1-e9df9bea6f8e.jpg +Barbora,2,"Kothajova, Barbora",Barbora Kothajová,Barbora Kothajová_ddae3b39-4de4-46d2-ac21-357950bd3647.jpg +Bohdan,2,"Myrinets, Bohdan",Bohdan Myrinets,Bohdan Myrinets_c4a37d2c-193a-4dcd-908e-bde39037e03a.jpg +Boris,1,"Kamenicky, Boris",Boris Kamenický,Boris Kamenický_6e95c266-4f16-45a6-a1bf-b43a9f6eb0c5.jpg +Branislav,1,"Lavicka, Branislav",Branislav Lavička,Branislav Lavička_774ab8a2-d1f8-42f5-ab76-38fbda45b400.jpg +Branislav,3,"Malinovsky, Branislav",Branislav Malinovský,Branislav Malinovský_bc0c9ae5-8703-4ecb-ab2e-f95ffbb62a21.jpg +Branislav,9,"Ulbrich, Branislav",Branislav Ulbrich,Branislav Ulbrich_ad09e41d-83f8-4c22-8f50-dd8b075cefc6.jpg +Bruno,2,"Hanus, Bruno",Bruno Hanus,BrunoHanus2.jpg +Cameron,2,"Cumming, Cameron",Cameron Cumming,Cumming Cameron_30f0bcec-62bf-4732-9778-4b8a129b3e04.jpg +Carlos,3,"Okada, Carlos",Carlos Okada,Carlos Okada_fe23147b-49a4-4a9d-8f6e-d2bd8c36913b.jpg +Danica,1,"Gligic, Danica",Danica Gligic,Danica Gligic_87c0af30-86b4-4db4-90f1-c9aa14c56ee3.jpg +Daniel,7,"Ferak, Daniel",Daniel Ferák,Daniel Ferák_11f873be-3bd7-4f59-ad8a-ca0efc340121.jpg +Daniel,0,"Gabris, Daniel",Daniel Gabriš,Daniel Gabriš_141a9735-0520-4491-83c8-7c8396284d06.jpg +Daniel,2,"Hladik, Daniel",Daniel Hladík,Daniel Hladík_53abc5c4-717a-4681-bfd3-0630c60f2da1.jpg +Daniel,10,"Pribul, Daniel",Daniel Pribul,Daniel Pribul_efc9fa2f-aa4a-40b2-b548-8446ee718e6f.jpg +Daniel,2,"Rosival, Daniel",Daniel Rosival,Daniel Rosival_d7d85569-1cb5-43a9-aef0-75a405e0cf29.jpg +Daniel,1,"Sak, Daniel",Daniel Sák,Daniel Sák_39a2403d-09ef-4f1d-8f09-5031e78c23f0.jpg +Dávid,2,"Slezak, David",Dávid Slezák,Dávid Slezák_6372ca61-5a4e-4f39-84e7-2c71186cbc58.jpg +Denis,2,"Stiglic, Denis",Denis Štiglic,Denis Štiglic_709bf842-24ee-4afa-8e58-7defd8a9399f.jpg +Dominik,4,"Dragun, Dominik",Dominik Dragún,Dominik Dragún_a64ee9c3-6f12-42dd-80f6-6ee2dc52bc3d.jpg +Dušan,1,"Sykora, Dusan",Dušan Sýkora,Dušan Sýkora_27491f59-291a-4307-9ee8-bca4142a3114.jpg +Eduard,0,"Vaisman, Eduard",Eduard Vaisman,Eduard Vaisman_ca13067d-d060-4917-8a9a-16d7e7914ebc.jpg +Egid,0,"Fertal, Egid",Egid Fertáľ,Egid Fertáľ_d92da628-bc2c-4ce3-bd71-9ec59b194a33.jpg +Ema,1,"Richnakova, Ema",Ema Richnáková,Ema Richnáková_ca78b2fa-26dd-4859-9f84-c8311a21246d.jpg +Eugen,5,"Viszus, Eugen",Eugen Viszus,Eugen Viszus_c7cf07e0-c0b9-4fc1-a2fb-156df6b1f96b.jpg +Eva,0,"Duriakova, Eva",Eva Ďuriaková,Eva Ďuriaková_f93a35be-b78c-490d-a0d1-c4f80f91f042.jpg +Fathi,1,"Hanif, Fathi",Fathi Hanif,Fathi Al-Kamil Hanif_e8bd7cf3-7d93-494d-b79a-5e3b5820d96d.jpg +Filip,2,"Blatak, Filip",Filip Blaťák,Filip Blaťák_bf3c12de-c2c0-4167-b95f-221f2c2a780a.jpg +Filip,4,"Lastic, Filip",Filip Láštic,Filip Láštic_df11ad3d-4f66-40a3-a91b-f61e22703710.jpg +Francisco,0,"Sousa, Francisco",Francisco Sousa,Sousa Francisco_7e3c0473-501d-4292-bee1-8526004683d7.jpg +Francisco,3,"Taboada, Francisco",Francisco Taboada,Francisco Taboada_2b29a990-24fd-4816-a1ab-50f5f7122881.jpg +Gabriel,5,"Halasi, Gabriel",Gabriel Halasi,Gabriel Halasi_956f94f3-71c7-4c06-a2c4-c1dd73cff9be.jpg +Haroldo,3,"Medeiros, Haroldo",Haroldo Medeiros,Haroldo Medeiros_3d659bc4-e10f-42cc-acec-0a91bc27e909.jpg +Igor,2,"Janos, Igor",Igor Jánoš,Igor Jánoš_bdf0981b-8338-4773-91e4-dc7717bdbdcc.jpg +Illia,0,"Ponomarov, Illia",Illia Ponomarov,Illia Ponomarov_6f1fabf1-f279-4b27-aa6d-2656e1abd831.jpg +Ivan,7,"Benovic, Ivan",Ivan Beňovic,Ivan Beňovic_39e7f413-22a2-49bb-ad84-fc3650ecbc09.jpg +Ivan,5,"Gardosik, Ivan",Ivan Gardošík,Ivan Gardošík_444f1b9b-a278-4949-b0c9-53d96c89a8cf.jpg +Jakub,3,"Hruska, Jakub",Jakub Hruška,Jakub Hruška_81ab6a30-260a-4426-878d-180c8cd95964.jpg +Jakub,3,"Morvay, Jakub",Jakub Morvay,Jakub Morvay_45e5a107-fce1-4c4e-82ad-1c389986059a.jpg +Jakub,5,"Muransky, Jakub",Jakub Muránsky,Jakub Muránsky_03ba7d5e-d5a5-4d1a-922a-9d50c7c6a157.jpg +Jakub,2,"Nemcek, Jakub",Jakub Nemček,Jakub Nemcek 40839-0-2.jpg +Jakub,6,"Safin, Jakub",Jakub Šafin,Jakub Safin 40637-0-2.jpg +Jakub,0,"Slamka, Jakub",Jakub Slámka,Jakub Slámka_e95d99bf-04a4-4b61-95d0-f0409fbefd4a.jpg +Jakub,3,"Sochor, Jakub",Jakub Sochor,Jakub Sochor_449a69ce-6855-4749-a531-386cf141e9b1.jpg +Jakub,2,"Spanhel, Jakub",Jakub Špaňhel,Jakub Špaňhel_e842e31e-8d2c-44d2-952b-6f1733e94b26.jpg +Jakub,2,"Urban, Jakub",Jakub Urban,Jakub Urban_804fc65d-1b74-40ff-b2d5-8df168808140.jpg +Jakub,4,"Vallo, Jakub",Jakub Vallo,Jakub Vallo_f7501aee-d1b9-41ba-8016-b28a8338a52d.jpg +Ján,3,"Herceg, Jan",Ján Herceg,Ján Herceg_5d94c0ec-55c9-4bdf-9c6b-452fb9b47acb.jpg +Ján,1,"Hudek, Jan",Ján Hudek,Ján Hudek_2e35d440-a5b3-4faa-a687-772d619f5a63.jpg +Ján,20,"Lunter, Jan",Ján Lunter,Jano Lunter_bae608f4-a372-49b2-8a11-3a2bc7756cbf.jpg +Ján,1,"Sliacky, Jan",Ján Sliacky,Ján Sliacky_e8d361c1-8444-4fda-b36c-f730c312049e.jpg +Jan,5,"Stratil, Jan",Jan Stratil,Jan Stratil_91674a30-7f0d-408e-8abd-83ad93f22d4a.jpg +Ján,5,"Zaborsky, Jan",Ján Záborský,Ján Záborský_afb59599-674d-46ca-ac20-922d826df467.jpg +Jana,6,"Farkasovska, Jana",Jana Farkašovská,Farkašovská Jana_7cb3283a-9cfe-48cf-95d2-aa9f2e81916c.jpg +Jana,0,"Gruntova, Jana",Jana Gruntova,Jana Gruntova 40963-0-2.jpg +Jana,0,"Spillane, Jana",Jana Spillane,Jana Spillane_908881a4-0892-43ce-a838-7975ffe26483.jpg +Jaroslav,2,"Gratz, Jaroslav",Jaroslav Gratz,Jaroslav Gratz_f583eac8-3619-4741-a6fa-37bff60d7071.jpg +Jayant,3,"Choudhary, Jayant",Jayant Choudhary,Jayant Choudhary_7a2e5e4e-fd78-4777-868d-f7759a30a971.jpg +John,3,"Xian, John",John Xian,John Xian 40780-0-2.jpg +Josef,1,"Slavicek, Josef",Josef Slavíček,Josef Slavíček_cd8fb0aa-fc4f-4de7-9734-aab1bb24522a.jpg +Jozef,3,"Drgona, Jozef",Jozef Drgoňa,Jozef Drgoňa_e913354e-8047-4d0d-88b4-4cee8fc21e90.jpg +Jozef,11,"Fulop, Jozef",Jozef Fülöp,Jozef Fülöp_bc4c89e5-b441-492a-9eb0-f1e4c3dc6100.jpg +Jozef,6,"Mlaka, Jozef",Jozef Mláka,Jozef Mláka_56829c14-7fec-4e40-a166-046e526a2456.jpg +Juraj,2,"Beres, Juraj",Juraj Béreš,Juraj Béreš_58779a2c-fa69-4a77-83f2-baa6be9c4abf.jpg +Juraj,0,"Guldan, Juraj",Juraj Guldán,Juraj Guldán_0a111e72-e866-4a96-9f91-713ea555fba4.jpg +Juraj,1,"Haluska, Juraj",Juraj Haluška,Juraj Haluška_5cdf8f4f-f22a-4f2b-b43f-ba1786c4cc36.jpg +Juraj,7,"Kukla, Juraj",Juraj Kukla,Juraj Kukla_e1366723-918c-4750-b22e-94b3fccfeb48.jpg +Juraj,14,"Labaj, Juraj",Juraj Labaj,Juraj Labaj_611c0720-42bf-4b65-9b6d-4ef3768fa60d.jpg +Katarína,1,"Bertok, Katarina",Katarína Bertók,Katarína Bertók_32d8c160-72ef-459e-b387-9053c060b7f4.jpg +Katarína,0,"Korcova, Katarina",Katarína Korcová,Katarína Korcová_32929765-4ddd-4927-aeef-e82a77bd3484.jpg +Katarína,5,"Milkova, Katarina",Katarína Milková,Katarina Milkova 40692-0-2.jpg +Katarína,0,"Posvanczova, Katarina",Katarína Posvanczová,Katarína Posvanczová_1af528ad-ddfa-4388-8d67-d2022954d86f.jpg +Klára,1,"Kazimirova, Klara",Klára Kazimírová,Klára Kazimírová_5f707214-0150-468e-98b1-ca78dd32c048.jpg +Linda,2,"Jurkasova, Linda",Linda Jurkasová,Linda Jurkasová_bd11e0ac-24a8-4eee-a092-efe87039ac1e.jpg +Lívia,1,"Balazova, Livia",Lívia Balážová,Lívia Veselovská_72fb8cff-2367-40b8-abd9-e45a9f01b937.jpg +Ľubomír,1,"Harmanovsky, Lubomir",Ľubomír Harmanovský,Ľubomír Harmanovský_99b51bb1-e655-4083-b267-7267fcabb969.jpg +Ľuboš,5,"Antal, Lubos",Ľuboš Antal,Ľuboš Antal_742c0f3a-3113-43ee-b5f1-cde4ccddc8eb.jpg +Lubos,0,"Kucera, Lubos",Luboš Kučera,Lubos Kucera 40947-0-2.jpg +Lucia,1,"Zimanova, Lucia",Lucia Zimanová,Lucia Zimanová_4aef60bc-02a9-4710-8bca-42689c6aec25.jpg +Luiz,0,"Caetano, Luiz",Luiz Caetano,Luiz Caetano 40971-0-2.jpg +Lukáš,4,"Malik, Lukas",Lukáš Malík,Lukáš Malík_f0c49b28-32ab-4b59-a92e-b0afe7860216.jpg +Lukas,14,"Vigas, Lukas",Lukáš Vigaš,Lukáš Vigaš_31607bb8-89df-4c5e-ac97-252a0f363479.jpg +Lýdia,5,"Hanuskova, Lydia",Lýdia Hanusková,Lýdia Hanusková_7bbec0cd-08dc-4c41-8364-1afc82e82d47.jpg +Marcela,0,"Mlkva, Marcela",Marcela Mlkvá,Marcela Mlkvá_13c9bf29-1d75-4a42-b191-6e95a0b07c68.jpg +Marek,2,"Helbich, Marek",Marek Helbich,Marek Helbich_8224c2a9-cbed-4818-a0f9-7be941553bd5.jpg +Marek,8,"Lipovsky, Marek",Marek Lipovský,Marek Lipovský_4b143c33-81b3-4924-9a95-9c86eb1eaa59.jpg +Marek,1,"Molisch, Marek",Marek Molisch,Marek Molisch_f8d26c79-bfc5-4731-8c2e-870f26a25834.jpg +Marek,7,"Nereca, Marek",Marek Nereča,Marek Nereča_44fb6617-d80d-405f-afc7-06cd7a717ef0.jpg +Mária,12,"Skopikova, Maria",Mária Škopíková,Mária Škopíková_08573341-75bf-41ab-a68c-fc12ef0dd9e0.jpg +Marián,7,"Cerina, Marian",Marián Cerina,Marián Cerina_50077b5d-b621-4afc-b11e-e4f67435248b.jpg +Marián,0,"Jazbec, Marian",Marián Jazbec,Marián Jazbec_694e645a-3de1-4df1-8eff-c529cdda4fb7.jpg +Mário,4,"Hruska, Mario",Mário Hruška,Mário Hruška_15a68b35-c964-4a39-838a-7a53d0709c0b.jpg +Mark,6,"Quiazon, Mark",Mark Quiazon,Mark Louie Quiazon_2215c656-757b-40ca-802a-239d5e16fbe6.jpg +Marko,0,"Stahovec, Marko",Marko Stahovec,Marko Stahovec_8bd4302a-dbb0-42ae-af7c-79decc1c9032.jpg +Martin,0,"Brisiak, Martin",Martin Brišiak,Martin Brišiak_9e2cc657-5352-430e-b182-6c453ae8101d.jpg +Martin,9,"Janusek, Martin",Martin Janušek,Martin Janušek_a5e1513e-aa79-4043-b2f3-88c0dc6d06ab.jpg +Martin,1,"Komorny, Martin",Martin Komorný,Martin Komorný_171974af-9d73-4fe0-b93b-c7a012d59073.jpg +Martin,0,"Lakatos, Martin",Martin Lakatos,Martin Lakatoš_ab717872-2ebd-4b72-9d8b-148027d64fa6.jpg +Martin,3,"Marko, Martin",Martin Marko,Martin Marko_6960b7ca-769c-40fb-8c31-23dbff7ea718.jpg +Martin,0,"Ondercin, Martin",Martin Onderčin,Martin Onderčin_4c2e0413-3dc3-4923-b329-bdfad332f511.jpg +Martin,1,"Zak, Martin",Martin Žák,Martin Žák_6932653b-362f-4452-bba1-58060334b553.jpg +Martina,1,"Budzinakova, Martina",Martina Budziňáková,Martina Budziňáková_8fafefe2-c081-48be-b3dd-8d1b95dbe7c6.jpg +Máté,12,"Fejes, Mate",Máté Fejes,Máté Fejes_5596ee27-05cf-4eac-9184-22dd79c2abe9.jpg +Matej,6,"Bizik, Matej",Matej Bízik,Matej Bízik_3f5f8b71-a6c7-4ca7-a3ec-71514bad59dd.jpg +Matej,2,"Friedel, Matej",Matej Friedel,Matej Friedel_3da18840-5140-49d9-93fb-a673ab8f21b8.jpg +Matej,0,"Guran, Matej",Matej Guráň,Matej Guráň_1a5c2647-3167-458d-92f6-f3e990146ac3.jpg +Matej,0,"Komlossy, Matej",Matej Komlóssy,Matej Komlóssy_64de6ba2-2e5f-4fb9-b7b8-d3d7f1f79ec6.jpg +Matej,0,"Spisak, Matej",Matej Spišák,Matej Spišák_9b28badf-f3a2-4fe3-8d31-018c4a27be25.jpg +Matúš,2,"Butora, Matus",Matúš Bútora,Matúš Bútora_f8bb29d3-4170-4d3a-9310-31792b875230.jpg +Matúš,3,"Gajdar, Matus",Matúš Gajdár,Matus Gajdar 40750-0-2.jpg +Matúš,0,"Horcik, Matus",Matúš Hôrčik,Matúš Hôrčik_762b52de-c860-43b1-b0d4-ac4342790c11.jpg +Matúš,16,"Kapusta, Matus",Matúš Kapusta,Matúš Kapusta_bf0a8603-f5a2-4d78-9ad1-283130672d99.jpg +Matúš,1,"Malinka, Matus",Matúš Malinka,Matúš Malinka_38ff9998-3019-48ae-b548-c6297c02f672.jpg +Matúš,3,"Michalik, Matus",Matúš Michalík,Matúš Michalík_5d9efde5-490d-4b94-960c-c202cd3bf737.jpg +Matúš,2,"Uhrin, Matus",Matúš Uhrín,Matúš Uhrín_343a75be-efda-4cd2-9984-33c3f30de4c7.jpg +Metod,7,"Rybar, Metod",Metod Rybár,Metod Rybár_0013b60c-b7ef-4d4d-bc33-592b3093bca2.jpg +Michael,0,"Krajanowski, Michael",Michael Krajanowski,Krajanowski Mike_22bfca47-329a-489b-adc3-2f981da99ac4.jpg +Michaela,1,"Cechova, Michaela",Michaela Čechová,Michaela Čechová_bf094293-66c3-4b29-85d3-fb2fec5a8e78.jpg +Michaela,2,"Frankova, Michaela",Michaela Franková,Michaela Franková_40b8fe31-40f4-4710-bbda-21e2b51814e3.jpg +Michaela,2,"Komorova, Michaela",Michaela Komorová,Michaela Komorová_b3e3a260-e0bb-4262-8293-ee22c2fbd759.jpg +Michal,0,"Bujna, Michal",Michal Bujna,Michal Bujna_0fd34e5a-a849-4703-8dd1-10b0744a6684.jpg +Michal,1,"Klco, Michal",Michal Klčo,Michal Klčo 40887-0-2.jpg +Michal,3,"Rohleder, Michal",Michal Rohleder,Michal Rohleder_b9eb0e27-0f60-4555-9279-4da2b5975e07.jpg +Michal,2,"Rychly, Michal",Michal Rychlý,Michal Rychlý_cc675a2f-bf38-4006-b2ef-6358ae6b98d8.jpg +Michal,2,"Stiglic, Michal",Michal Štiglic,Michal Stiglic 40831-0-2.jpg +Michal,5,"Vilagi, Michal",Michal Világi,Michal Világi_67f724f7-81ea-4687-a471-46b7ef4a4d33.jpg +Michal,11,"Zelenak, Michal",Michal Zelenák,Michal Zelenák_915a060e-0b29-49e1-a75a-f0eb74257a45.jpg +Milan,2,"Halabuk, Milan",Milan Halabuk,Milan Halabuk_f34cd64b-a64f-45dd-9db6-dc229049509a.jpg +Milan,0,"Vozarik, Milan",Milan Vozárik,Milan Vozárik_30b39c71-1d82-4e84-b9c7-09b18ec84605.jpg +Mohammed,1,"Saleem, Mohammed",Mohammed Saleem,Raffay Saleem 1663883991704.jpeg +Moises,0,"Silva, Moises",Moises Silva,Moises Silva 40972-0-2.jpg +Monika,0,"Padysakova, Monika",Monika Padyšáková,MonikaPadisakova.jpg +Monika,0,"Starke, Monika",Monika Starke,Monika Starke_4a2b5858-c883-4cd1-b2c0-2aaa96ca4e51.jpg +Myroslav,7,"Nastenko, Myroslav",Myroslav Nastenko,Myroslav Nastenko_8eee8bfd-e41a-4e3e-917c-3e6525a55645.jpg +Oscar,11,"Flores, Oscar",Oscar Flores,Oscar Flores_3f5548c3-9cdb-4b94-82af-650c7f11d58f.jpg +Oskar,0,"Hausknotz, Oskar",Oskar Hausknotz,Oskar Hausknotz_16d22721-dced-4447-9b0b-97ce51f7348b.jpg +Pablo,3,"Borba, Pablo",Pablo Borba,Borba Pablo_b240563c-eb99-44af-9d4f-1f0130e495ba.jpg +Patrik,1,"Mydlar, Patrik",Patrik Mydlár,Patrik Mydlár_2f09b48d-0506-42ba-8f78-7670840d742f.jpg +Patrik,2,"Tomco, Patrik",Patrik Tomčo,Patrik Tomčo_6e1c7ba5-06e2-4e59-85d8-4360a14e26f6.jpg +Pavel,5,"Grunt, Pavel",Pavel Grunt,Pavel Grunt_b12bf052-b765-4c76-9c7c-6bd360a0efb4.jpg +Peter,9,"Drahos, Peter",Peter Drahoš,Peter Drahoš_4f686bb2-3c6d-423b-b398-50fe1b1e4dd7.jpg +Peter,8,"Molcany, Peter",Peter Molčány,Peter Molčány_2615b136-bb7c-47d2-9ab7-c901e6af274a.jpg +Peter,2,"Muzslay, Peter",Peter Muzslay,Peter Muzslay_ad0ad204-57ef-443d-b1cf-6b9b29408233.jpg +Peter,2,"Pokojny, Peter",Peter Pokojný,Peter Pokojný_3ae84c84-14ab-44f8-93d9-83194759206b.jpg +Peter,3,"Poliak, Peter",Peter Poliak,Peter Poliak_4277323d-e330-4ade-9d06-1d32756bf161.jpg +Peter,1,"Rendek, Peter",Peter Rendek,Peter Rendek_3bf4604a-bcc4-42a4-86c7-3eb7a4a4f401.jpg +Peter,3,"Striz, Peter",Peter Stríž,Peter Stríž_49617e60-da63-4db4-98ab-46ea1ff9a12b.jpg +Petr,3,"Chmelar, Petr",Petr Chmelař,Petr Chmelař_71848724-096a-40b1-bba9-dbf97b2a6a0a.jpg +Petr,10,"Duchacek, Petr",Petr Ducháček,Petr Ducháček_e3ac12d8-499e-474b-aa94-d725b1337c21.jpg +Petr,0,"Dvoracek, Petr",Petr Dvořáček,Petr Dvoracek 40974-0-2.jpg +Petr,0,"Hurtik, Petr",Petr Hurtík,Petr Hurtík_d1ddcca2-185c-4ab8-88d9-9b91f6499ce2.jpg +Radek,10,"Benes, Radek",Radek Beneš,Radek Beneš_7e9c6e47-8df5-42e5-a191-040180b80daa.jpg +Radoslav,6,"Cagala, Radoslav",Radoslav Čagala,Radoslav Čagala_11fc81d5-fad4-435d-b356-c57c11282de8.jpg +Ralph,0,"Awika, Ralph",Ralph Awika,Awika Ralph_2a79fdc4-8c8d-4342-a84c-2aeadccac4ba.jpg +Richard,10,"Lunter, Richard",Richard Lunter,Lunter Richard_0f04423a-6ed3-4d80-a586-d82d78564c15.jpg +Richard,0,"Szarka, Richard",Richard Szarka,Richard Szarka_34dab4f2-4c69-44e0-a468-b91f277c1bb1.jpg +Roman,2,"Danko, Roman",Roman Danko,Roman Danko_c4b8b483-55b6-46d2-a855-8920ab6d8fe0.jpg +Ronald,3,"Ruzicka, Ronald",Ronald Ružička,Ronald Ružička_5eb6ecce-5593-4ec0-8074-b8c2e5edf0a6.jpg +Safia,1,"Bagin, Safia",Safia Bagin,Safia Bagin_3f1b2d43-63fa-4b54-8466-8664d8a84beb.jpg +Samuel,7,"Valis, Samuel",Samuel Vališ,Samuel Vališ_d609598b-437c-417f-bf3a-15365034cee1.jpg +Serhii,2,"Viazelenko, Serhii",Serhii Viazelenko,Serhii Viazelenko_77ac87fd-9a1f-4d24-a75e-d38c5795e3ef.jpg +Silvester,1,"Kosmel, Silvester",Silvester Kosmeľ,Silvester Kosmeľ_acd8e7e9-8450-4bfc-81e2-2a05cea6f66e.jpg +Silvester,0,"Pullman, Silvester",Silvester Pullman,Silvester Pullman_94c80531-53d8-4814-abcb-d69dfac7a996.jpg +Šimon,0,"Kostolny, Simon",Šimon Kostolný,Šimon Kostolný_f181b548-31cb-4fd4-827f-2400bd8e32ab.jpg +Soňa,0,"Babjakova, Sona",Soňa Babjaková,Soňa Babjaková_133d59df-ca3f-472a-a7f2-5169eb2c7c88.jpg +Stanislav,0,"Benaci, Stanislav",Stanislav Benáci,Stanislav Benáci_42a69bd8-ae4c-4eac-a58d-a2ba268fe362.jpg +Stanislav,4,"Orsula, Stanislav",Stanislav Oršula,Stanislav Oršula_5b5c1514-4b6a-44fd-aee4-038bb0f48d56.jpg +Štefan,6,"Bellus, Stefan",Štefan Bellus,Štefan Bellus_81dc68a8-a424-40b0-baaf-e24020d490e9.jpg +Štěpán,6,"Lendak, Stepan",Štěpán Lenďák,Štěpán Lenďák_d710d91b-f2df-421d-a3fa-1d0e7b03c694.jpg +Tatjana,2,"Piksiades, Tatjana",Tatjana Piksiades,Tatjana Piksiades_3ff1e195-eaa0-4208-9618-e076fa3b345a.jpg +Thiago,2,"Prado, Thiago",Thiago Prado,Thiago Prado_e74ae19e-ba9d-43cf-b309-b4139487ad3d.jpg +Tomáš,11,"Antolik, Tomas",Tomáš Antolík,Tomáš Antolík_ad2929d9-15e7-4e68-aff3-45c2345d17fe.jpg +Tomáš,2,"Bittsansky, Tomas",Tomáš Bittšánsky,Tomáš Bittšánsky_49d103e5-d408-4565-b12f-37b64c3697bd.jpg +Tomáš,4,"Krupa, Tomas",Tomáš Krupa,Tomáš Krupa_7bbb1cfc-c5da-498b-b90d-c52aaa21ee9b.jpg +Tomáš,2,"Lasak, Tomas",Tomáš Lasak,Tomáš Lasak_d50d2de7-a979-4a9a-a09e-7973ab702d99.jpg +Tomáš,2,"Muzika, Tomas",Tomáš Mužika,Tomáš Mužika_7bcebe22-a86a-45eb-bbd3-8899b3fbf2a8.jpg +Tomas,11,"Pribyl, Tomas",Tomáš Přibyl,Tomas Pribyl 40564-1-2.jpg +Tomáš,1,"Repak, Tomas",Tomáš Repák,Tomas Repak 40913-0-2.jpg +Tomáš,1,"Venkrbec, Tomas",Tomáš Venkrbec,Tomáš Venkrbec_310f8370-9eb6-4d35-8f4f-56d7150c8658.jpg +Václav,3,"Stransky, Vaclav",Václav Stránský,Václav Stránský_77b8bed4-8724-4045-950e-87fc1d9cb7bb.jpg +Vanda,5,"Dodokova, Vanda",Vanda Dodoková,Vanda Dodoková_7c6b3072-f915-4bc1-bdff-b4f8bfda2847.jpg +Veronika,3,"Polakova, Veronika",Veronika Poláková,Veronika Poláková_27b3e229-cfa5-4d81-97e3-fe18a44a9a80.jpg +Viktor,3,"Bielko, Viktor",Viktor Bielko,Viktor Bielko_6a2ddb7b-a9fb-4fca-a755-f80e82be24dd.jpg +Viktor,2,"Molnar, Viktor",Viktor Molnár,Viktor Molnár_25e49c67-1e85-41bf-926d-25ccda00f277.jpg +Viktoria,7,"Matunakova, Viktoria",Viktória Matunáková,Viktória Matunáková_ff9e82b7-31c8-4060-ae20-edf724d9e343.jpg +Vladimír,18,"Kostiviar, Vladimir",Vladimír Kostiviar,Vlado Kostiviar_f9eaad98-0ca6-4f9e-9283-cf8d4bae0940.jpg +Yevhenii,1,"Kurinov, Yevhenii",Yevhenii Kurinov,Yevhenii Kurinov_5e8bf51a-2088-47a9-bb88-b9a1657c2fc9.jpg +Vojta,3,"Diatka, Vojta",Vojta Diatka,Vojta Diatka_db50703a-0482-479f-ac03-128674bca9f2.jpg +Jakub,4,"Supa, Jakub",Jakub Šupa,Jakub Šupa_38f625d1-6586-4c23-823d-b43fd73d05ba.jpg +Tereza,5,"Cerina, Tereza",Tereza Cerina,Tereza Cerina_9202b4f3-cea1-4474-84ce-6cdf4cbc02b4.jpg diff --git a/src/scripts/migrate-watchlist-members/seedingScript/removeUsers.ps1 b/src/scripts/migrate-watchlist-members/seedingScript/removeUsers.ps1 new file mode 100644 index 0000000..73ba23b --- /dev/null +++ b/src/scripts/migrate-watchlist-members/seedingScript/removeUsers.ps1 @@ -0,0 +1,20 @@ +Invoke-RestMethod -ContentType "application/json" -Method Post -Uri http://sface-integ-2u:8097/graphql/ -Body (@{variables = $null; query = ` +'query { + watchlistMembers(take: 1000) { + items { + fullName + displayName + id + + + } + } +}'} | ConvertTo-Json) | ` +Select-Object -ExpandProperty data | ` +Select-Object -ExpandProperty watchlistMembers | ` +Select-Object -ExpandProperty items | ` +ForEach-Object { + +Invoke-RestMethod -Method Delete -Uri http://sface-integ-2u:8098/api/v1/WatchlistMembers/$($_.id) +Write-Host "$($_.id) $($_.fullName) $($_.displayName)" +} \ No newline at end of file diff --git a/src/scripts/migrate-watchlist-members/seedingScript/seedDatabase.py b/src/scripts/migrate-watchlist-members/seedingScript/seedDatabase.py new file mode 100644 index 0000000..35c1b30 --- /dev/null +++ b/src/scripts/migrate-watchlist-members/seedingScript/seedDatabase.py @@ -0,0 +1,142 @@ +import csv +import requests +import json +import base64 +import os + +# Define the API endpoint +API_ENDPOINT = "http://sface-integ-2u:8098/api/v1/WatchlistMembers/Register" +WATCHLIST_ID = "13d80d4b-f512-46ca-9d36-3732fd615f04" +IMAGE_FOLDER = "images" # Folder where images are stored + +countSuccess = 0 +countFailed = 0 +failedData = [] + +# Function to read and encode image as base64 +def get_image_base64(image_filename): + # Construct the full path to the image file + image_path = os.path.join(IMAGE_FOLDER, image_filename) + + try: + # Read the image file and encode it to base64 + with open(image_path, "rb") as image_file: + encoded_string = base64.b64encode(image_file.read()).decode('utf-8') + return encoded_string + except FileNotFoundError: + print(f"Image file '{image_filename}' not found.") + return "" + +# Function to send POST request to the API +def send_data_to_api(name, full_name, note, image_data, years,recordnumber): + global countSuccess + global countFailed + global failedData + + payload = { + "id": recordnumber, + "images": [ + { + "faceId": None, + "data": image_data # Base64 image encoded data + } + ], + "watchlistIds": [ + WATCHLIST_ID + ], + "faceDetectorConfig": { + "minFaceSize": 25, + "maxFaceSize": 600, + "maxFaces": 20, + "confidenceThreshold": 300 + }, + "faceDetectorResourceId": "cpu", + "templateGeneratorResourceId": "cpu", + "keepAutoLearnPhotos": False, + "displayName": name, + "fullName": name, + "note": years, + "labels": [{ + + "key": "years", + "value": years + } + ] + } + + headers = {'Content-Type': 'application/json'} + + # Sending the POST request to the API + response = requests.post(API_ENDPOINT, headers=headers, data=json.dumps(payload)) + + if response.status_code == 201: + print(f"Success: {note} data sent.") + countSuccess += 1 + else: + failedMessage = f"Failed to send data for {note}. Status code: {response.status_code}, Response: {response.text}" + print(failedMessage) + countFailed += 1 + failedData.append({ + 'name': note, + 'status': response.status_code, + 'response': response.text + }) + +# Function to read CSV and process data +def process_csv_and_send_data(csv_file_path): + with open(csv_file_path, mode='r', encoding='utf-8-sig') as file: + csv_reader = csv.DictReader(file, quotechar='"') + + # Print the headers to check if they are correct + headers = csv_reader.fieldnames + print("CSV Headers:", headers) # This will show what headers are actually being recognized + + recordnumber = 1 + + for row in csv_reader: + # Check if the 'Name' column exists + if 'Name' not in row: + print("Error: 'Name' column not found in the CSV. Check the headers.") + return # Stop the script if 'Name' column is missing + + # Extract relevant data from CSV + name = row['Name'] + note = row['Name and Surname'] + image_file = row['Images'] # Get the image filename from the 'Images' column + years = row['Years'] + + # Encode the image to base64 + image_data = get_image_base64(image_file) if image_file else "" + + # Call API with the extracted data + send_data_to_api(name, name, note, image_data, years, recordnumber) + recordnumber += 1 + +def log_failed_data(log_file_path, failed_data): + # Open the log file in append mode + with open(log_file_path, 'a', encoding='utf-8') as log_file: + for fail in failed_data: + # Print the failed data + print(fail) + + # Write the failed data to the log file + log_file.write(f"Name: {fail['name']}\n") + log_file.write(f"Status Code: {fail['status']}\n") + log_file.write(f"Response: {fail['response']}\n") + log_file.write("\n") # Add a newline to separate entries + +# Specify the path to your CSV file +csv_file_path = r'c:\Users\jberes\Documents\work\Projects\2024\20th-Anniversary\scripts\seedingScript\employees_v01.csv' + +# Process CSV and send data +process_csv_and_send_data(csv_file_path) + +# Example usage after processing all data +log_file_path = 'failed_data_log.txt' + +# Call the logging function after your CSV processing is done +if failedData: + log_failed_data(log_file_path, failedData) + +print(f"Total Success: {countSuccess}") +print(f"Total Failed: {countFailed}") \ No newline at end of file From 5263808db041919ea632d8ef4040d40e65491d09 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Wed, 30 Oct 2024 08:20:06 +0100 Subject: [PATCH 02/11] initial seed --- .../seedingScript/employees_v01.csv | 215 ------------------ 1 file changed, 215 deletions(-) delete mode 100644 src/scripts/migrate-watchlist-members/seedingScript/employees_v01.csv diff --git a/src/scripts/migrate-watchlist-members/seedingScript/employees_v01.csv b/src/scripts/migrate-watchlist-members/seedingScript/employees_v01.csv deleted file mode 100644 index b5e11c6..0000000 --- a/src/scripts/migrate-watchlist-members/seedingScript/employees_v01.csv +++ /dev/null @@ -1,215 +0,0 @@ -Name,Years,"Last name, First name",Name and Surname,Images -Adam,0,"Furi, Adam",Adam Füri,Adam Füri_5330414e-4f38-4b77-ae00-ce2f8c29ddec.jpg -Adam,0,"Matyas, Adam",Adam Mátyás,Adam Mátyás_d679be1a-6033-411c-aa41-2359d1a3cb37.jpg -Adrián,8,"Fejes, Adrian",Adrián Fejes,Adrián Feješ_4ceaa4ee-ac1f-45ba-9c0a-9a5339a7f99a.jpg -Adriena,0,"Mozgayova, Adriena",Adriena Mozgayova,Adriena Mozgayová_67344f35-dd5f-4573-8551-d338ce810b69.jpg -Adriena,2,"Nemethova, Adriena",Adriena Némethová,Adriena Némethová_0be9755b-baee-40e8-b9c3-ad24ce9e6fbf.jpg -Ákos,0,"Levardy, Akos",Ákos Lévárdy,Akos Levardy_33db475f-596d-4f71-bdd4-f2dccb3957b1.jpg -Alejandro,5,"Aleman, Alejandro",Alejandro Alemán,Alejandro Alemán_a94890fb-5982-48ef-ac56-1ff9e662ccbf.jpg -Aleksandra,0,"Krstevska, Aleksandra",Aleksandra Krstevska,Krstevska Aleksandra_b5997997-249a-4e62-a5e9-55f96a6736ca.jpg -Alena,7,"Szentandrasi, Alena",Alena Szentandrási,Alena D-Szentandrási_d47b8fd8-de78-4b37-ba61-c264e04d88db.jpg -Alexandre,3,"Godoy, Alexandre",Alexandre Godoy,Alexandre Godoy_c5a42966-dac2-40a0-aa26-5a8f6b897da2.jpg -Alica,2,"Holla, Alica",Alica Hollá,Alica Hollá_9e57b5e6-f8bc-427a-8062-836dc24dff23.jpg -Andrea,5,"Karabova, Andrea",Andrea Karabová,Andrea Karabová_17ae0c30-a1c9-472c-be3e-c66839d7dd90.jpg -Andrea,2,"Korcokova, Andrea",Andrea Korčoková,Andrea Korčoková_0d16fbbf-461c-4491-8f33-47586381d1eb.jpg -Andrea,0,"Majanova, Andrea",Andrea Majanová,Andrea Majanová_e28f5070-ba3c-4d85-b948-11417a67218f.jpg -Andrei,0,"Oleinikov, Andrei",Andrei Oleinikov,Andrei Oleinikov_752ab0d2-fb63-4be0-94ee-c69c67174d5c.jpg -Andrej,6,"Kobercik, Andrej",Andrej Koberčík,Andrej Koberčík_2d00d053-9b44-48d2-bf9a-70ef8b4b4037.jpg -Andrej,5,"Toth, Andrej",Andrej Tóth,Andrej Tóth_2562f13d-77e4-4d2b-a8f2-2f1faaaa735c.jpg -Andrii,1,"Danilin, Andrii",Andrii Danilin,Andrii Danilin_6b0082c1-4573-4c44-99ff-ae85c43c5550.jpg -Anna,0,"Drahan, Anna",Anna Drahan,Anna Drahan_0dfcf80b-11ad-4f45-a9fc-1e7acbcd07a4.jpg -Anna,0,"Tkacova, Anna",Anna Tkáčová,Anna Tkáčová_c02806cc-d45e-4bac-aac5-3ab0182f265c.jpg -Attila,2,"Mucka, Attila",Attila Múčka,Attila Múčka_2b16806b-5c55-403a-a9c9-6a15b80194b7.jpg -Barbara,0,"Rybarova, Barbara",Barbara Rybárová,Barbara Rybárová_3c52565c-31b8-4f51-99da-9787a2429788.jpg -Barbora,0,"Barancova, Barbora",Barbora Barancová,Barbora Barancová_4b1cc5e3-f663-4924-85cc-b91274359b1e.jpg -Barbora,8,"Chabadova, Barbora",Barbora Chabadová,Barbora Chabadová_dd877820-2440-45d4-a4af-6f85c1089f5d.jpg -Barbora,2,"Horvat, Barbora",Barbora Horvat,Barbora Horvat_5d80b621-6181-4476-8eb1-e9df9bea6f8e.jpg -Barbora,2,"Kothajova, Barbora",Barbora Kothajová,Barbora Kothajová_ddae3b39-4de4-46d2-ac21-357950bd3647.jpg -Bohdan,2,"Myrinets, Bohdan",Bohdan Myrinets,Bohdan Myrinets_c4a37d2c-193a-4dcd-908e-bde39037e03a.jpg -Boris,1,"Kamenicky, Boris",Boris Kamenický,Boris Kamenický_6e95c266-4f16-45a6-a1bf-b43a9f6eb0c5.jpg -Branislav,1,"Lavicka, Branislav",Branislav Lavička,Branislav Lavička_774ab8a2-d1f8-42f5-ab76-38fbda45b400.jpg -Branislav,3,"Malinovsky, Branislav",Branislav Malinovský,Branislav Malinovský_bc0c9ae5-8703-4ecb-ab2e-f95ffbb62a21.jpg -Branislav,9,"Ulbrich, Branislav",Branislav Ulbrich,Branislav Ulbrich_ad09e41d-83f8-4c22-8f50-dd8b075cefc6.jpg -Bruno,2,"Hanus, Bruno",Bruno Hanus,BrunoHanus2.jpg -Cameron,2,"Cumming, Cameron",Cameron Cumming,Cumming Cameron_30f0bcec-62bf-4732-9778-4b8a129b3e04.jpg -Carlos,3,"Okada, Carlos",Carlos Okada,Carlos Okada_fe23147b-49a4-4a9d-8f6e-d2bd8c36913b.jpg -Danica,1,"Gligic, Danica",Danica Gligic,Danica Gligic_87c0af30-86b4-4db4-90f1-c9aa14c56ee3.jpg -Daniel,7,"Ferak, Daniel",Daniel Ferák,Daniel Ferák_11f873be-3bd7-4f59-ad8a-ca0efc340121.jpg -Daniel,0,"Gabris, Daniel",Daniel Gabriš,Daniel Gabriš_141a9735-0520-4491-83c8-7c8396284d06.jpg -Daniel,2,"Hladik, Daniel",Daniel Hladík,Daniel Hladík_53abc5c4-717a-4681-bfd3-0630c60f2da1.jpg -Daniel,10,"Pribul, Daniel",Daniel Pribul,Daniel Pribul_efc9fa2f-aa4a-40b2-b548-8446ee718e6f.jpg -Daniel,2,"Rosival, Daniel",Daniel Rosival,Daniel Rosival_d7d85569-1cb5-43a9-aef0-75a405e0cf29.jpg -Daniel,1,"Sak, Daniel",Daniel Sák,Daniel Sák_39a2403d-09ef-4f1d-8f09-5031e78c23f0.jpg -Dávid,2,"Slezak, David",Dávid Slezák,Dávid Slezák_6372ca61-5a4e-4f39-84e7-2c71186cbc58.jpg -Denis,2,"Stiglic, Denis",Denis Štiglic,Denis Štiglic_709bf842-24ee-4afa-8e58-7defd8a9399f.jpg -Dominik,4,"Dragun, Dominik",Dominik Dragún,Dominik Dragún_a64ee9c3-6f12-42dd-80f6-6ee2dc52bc3d.jpg -Dušan,1,"Sykora, Dusan",Dušan Sýkora,Dušan Sýkora_27491f59-291a-4307-9ee8-bca4142a3114.jpg -Eduard,0,"Vaisman, Eduard",Eduard Vaisman,Eduard Vaisman_ca13067d-d060-4917-8a9a-16d7e7914ebc.jpg -Egid,0,"Fertal, Egid",Egid Fertáľ,Egid Fertáľ_d92da628-bc2c-4ce3-bd71-9ec59b194a33.jpg -Ema,1,"Richnakova, Ema",Ema Richnáková,Ema Richnáková_ca78b2fa-26dd-4859-9f84-c8311a21246d.jpg -Eugen,5,"Viszus, Eugen",Eugen Viszus,Eugen Viszus_c7cf07e0-c0b9-4fc1-a2fb-156df6b1f96b.jpg -Eva,0,"Duriakova, Eva",Eva Ďuriaková,Eva Ďuriaková_f93a35be-b78c-490d-a0d1-c4f80f91f042.jpg -Fathi,1,"Hanif, Fathi",Fathi Hanif,Fathi Al-Kamil Hanif_e8bd7cf3-7d93-494d-b79a-5e3b5820d96d.jpg -Filip,2,"Blatak, Filip",Filip Blaťák,Filip Blaťák_bf3c12de-c2c0-4167-b95f-221f2c2a780a.jpg -Filip,4,"Lastic, Filip",Filip Láštic,Filip Láštic_df11ad3d-4f66-40a3-a91b-f61e22703710.jpg -Francisco,0,"Sousa, Francisco",Francisco Sousa,Sousa Francisco_7e3c0473-501d-4292-bee1-8526004683d7.jpg -Francisco,3,"Taboada, Francisco",Francisco Taboada,Francisco Taboada_2b29a990-24fd-4816-a1ab-50f5f7122881.jpg -Gabriel,5,"Halasi, Gabriel",Gabriel Halasi,Gabriel Halasi_956f94f3-71c7-4c06-a2c4-c1dd73cff9be.jpg -Haroldo,3,"Medeiros, Haroldo",Haroldo Medeiros,Haroldo Medeiros_3d659bc4-e10f-42cc-acec-0a91bc27e909.jpg -Igor,2,"Janos, Igor",Igor Jánoš,Igor Jánoš_bdf0981b-8338-4773-91e4-dc7717bdbdcc.jpg -Illia,0,"Ponomarov, Illia",Illia Ponomarov,Illia Ponomarov_6f1fabf1-f279-4b27-aa6d-2656e1abd831.jpg -Ivan,7,"Benovic, Ivan",Ivan Beňovic,Ivan Beňovic_39e7f413-22a2-49bb-ad84-fc3650ecbc09.jpg -Ivan,5,"Gardosik, Ivan",Ivan Gardošík,Ivan Gardošík_444f1b9b-a278-4949-b0c9-53d96c89a8cf.jpg -Jakub,3,"Hruska, Jakub",Jakub Hruška,Jakub Hruška_81ab6a30-260a-4426-878d-180c8cd95964.jpg -Jakub,3,"Morvay, Jakub",Jakub Morvay,Jakub Morvay_45e5a107-fce1-4c4e-82ad-1c389986059a.jpg -Jakub,5,"Muransky, Jakub",Jakub Muránsky,Jakub Muránsky_03ba7d5e-d5a5-4d1a-922a-9d50c7c6a157.jpg -Jakub,2,"Nemcek, Jakub",Jakub Nemček,Jakub Nemcek 40839-0-2.jpg -Jakub,6,"Safin, Jakub",Jakub Šafin,Jakub Safin 40637-0-2.jpg -Jakub,0,"Slamka, Jakub",Jakub Slámka,Jakub Slámka_e95d99bf-04a4-4b61-95d0-f0409fbefd4a.jpg -Jakub,3,"Sochor, Jakub",Jakub Sochor,Jakub Sochor_449a69ce-6855-4749-a531-386cf141e9b1.jpg -Jakub,2,"Spanhel, Jakub",Jakub Špaňhel,Jakub Špaňhel_e842e31e-8d2c-44d2-952b-6f1733e94b26.jpg -Jakub,2,"Urban, Jakub",Jakub Urban,Jakub Urban_804fc65d-1b74-40ff-b2d5-8df168808140.jpg -Jakub,4,"Vallo, Jakub",Jakub Vallo,Jakub Vallo_f7501aee-d1b9-41ba-8016-b28a8338a52d.jpg -Ján,3,"Herceg, Jan",Ján Herceg,Ján Herceg_5d94c0ec-55c9-4bdf-9c6b-452fb9b47acb.jpg -Ján,1,"Hudek, Jan",Ján Hudek,Ján Hudek_2e35d440-a5b3-4faa-a687-772d619f5a63.jpg -Ján,20,"Lunter, Jan",Ján Lunter,Jano Lunter_bae608f4-a372-49b2-8a11-3a2bc7756cbf.jpg -Ján,1,"Sliacky, Jan",Ján Sliacky,Ján Sliacky_e8d361c1-8444-4fda-b36c-f730c312049e.jpg -Jan,5,"Stratil, Jan",Jan Stratil,Jan Stratil_91674a30-7f0d-408e-8abd-83ad93f22d4a.jpg -Ján,5,"Zaborsky, Jan",Ján Záborský,Ján Záborský_afb59599-674d-46ca-ac20-922d826df467.jpg -Jana,6,"Farkasovska, Jana",Jana Farkašovská,Farkašovská Jana_7cb3283a-9cfe-48cf-95d2-aa9f2e81916c.jpg -Jana,0,"Gruntova, Jana",Jana Gruntova,Jana Gruntova 40963-0-2.jpg -Jana,0,"Spillane, Jana",Jana Spillane,Jana Spillane_908881a4-0892-43ce-a838-7975ffe26483.jpg -Jaroslav,2,"Gratz, Jaroslav",Jaroslav Gratz,Jaroslav Gratz_f583eac8-3619-4741-a6fa-37bff60d7071.jpg -Jayant,3,"Choudhary, Jayant",Jayant Choudhary,Jayant Choudhary_7a2e5e4e-fd78-4777-868d-f7759a30a971.jpg -John,3,"Xian, John",John Xian,John Xian 40780-0-2.jpg -Josef,1,"Slavicek, Josef",Josef Slavíček,Josef Slavíček_cd8fb0aa-fc4f-4de7-9734-aab1bb24522a.jpg -Jozef,3,"Drgona, Jozef",Jozef Drgoňa,Jozef Drgoňa_e913354e-8047-4d0d-88b4-4cee8fc21e90.jpg -Jozef,11,"Fulop, Jozef",Jozef Fülöp,Jozef Fülöp_bc4c89e5-b441-492a-9eb0-f1e4c3dc6100.jpg -Jozef,6,"Mlaka, Jozef",Jozef Mláka,Jozef Mláka_56829c14-7fec-4e40-a166-046e526a2456.jpg -Juraj,2,"Beres, Juraj",Juraj Béreš,Juraj Béreš_58779a2c-fa69-4a77-83f2-baa6be9c4abf.jpg -Juraj,0,"Guldan, Juraj",Juraj Guldán,Juraj Guldán_0a111e72-e866-4a96-9f91-713ea555fba4.jpg -Juraj,1,"Haluska, Juraj",Juraj Haluška,Juraj Haluška_5cdf8f4f-f22a-4f2b-b43f-ba1786c4cc36.jpg -Juraj,7,"Kukla, Juraj",Juraj Kukla,Juraj Kukla_e1366723-918c-4750-b22e-94b3fccfeb48.jpg -Juraj,14,"Labaj, Juraj",Juraj Labaj,Juraj Labaj_611c0720-42bf-4b65-9b6d-4ef3768fa60d.jpg -Katarína,1,"Bertok, Katarina",Katarína Bertók,Katarína Bertók_32d8c160-72ef-459e-b387-9053c060b7f4.jpg -Katarína,0,"Korcova, Katarina",Katarína Korcová,Katarína Korcová_32929765-4ddd-4927-aeef-e82a77bd3484.jpg -Katarína,5,"Milkova, Katarina",Katarína Milková,Katarina Milkova 40692-0-2.jpg -Katarína,0,"Posvanczova, Katarina",Katarína Posvanczová,Katarína Posvanczová_1af528ad-ddfa-4388-8d67-d2022954d86f.jpg -Klára,1,"Kazimirova, Klara",Klára Kazimírová,Klára Kazimírová_5f707214-0150-468e-98b1-ca78dd32c048.jpg -Linda,2,"Jurkasova, Linda",Linda Jurkasová,Linda Jurkasová_bd11e0ac-24a8-4eee-a092-efe87039ac1e.jpg -Lívia,1,"Balazova, Livia",Lívia Balážová,Lívia Veselovská_72fb8cff-2367-40b8-abd9-e45a9f01b937.jpg -Ľubomír,1,"Harmanovsky, Lubomir",Ľubomír Harmanovský,Ľubomír Harmanovský_99b51bb1-e655-4083-b267-7267fcabb969.jpg -Ľuboš,5,"Antal, Lubos",Ľuboš Antal,Ľuboš Antal_742c0f3a-3113-43ee-b5f1-cde4ccddc8eb.jpg -Lubos,0,"Kucera, Lubos",Luboš Kučera,Lubos Kucera 40947-0-2.jpg -Lucia,1,"Zimanova, Lucia",Lucia Zimanová,Lucia Zimanová_4aef60bc-02a9-4710-8bca-42689c6aec25.jpg -Luiz,0,"Caetano, Luiz",Luiz Caetano,Luiz Caetano 40971-0-2.jpg -Lukáš,4,"Malik, Lukas",Lukáš Malík,Lukáš Malík_f0c49b28-32ab-4b59-a92e-b0afe7860216.jpg -Lukas,14,"Vigas, Lukas",Lukáš Vigaš,Lukáš Vigaš_31607bb8-89df-4c5e-ac97-252a0f363479.jpg -Lýdia,5,"Hanuskova, Lydia",Lýdia Hanusková,Lýdia Hanusková_7bbec0cd-08dc-4c41-8364-1afc82e82d47.jpg -Marcela,0,"Mlkva, Marcela",Marcela Mlkvá,Marcela Mlkvá_13c9bf29-1d75-4a42-b191-6e95a0b07c68.jpg -Marek,2,"Helbich, Marek",Marek Helbich,Marek Helbich_8224c2a9-cbed-4818-a0f9-7be941553bd5.jpg -Marek,8,"Lipovsky, Marek",Marek Lipovský,Marek Lipovský_4b143c33-81b3-4924-9a95-9c86eb1eaa59.jpg -Marek,1,"Molisch, Marek",Marek Molisch,Marek Molisch_f8d26c79-bfc5-4731-8c2e-870f26a25834.jpg -Marek,7,"Nereca, Marek",Marek Nereča,Marek Nereča_44fb6617-d80d-405f-afc7-06cd7a717ef0.jpg -Mária,12,"Skopikova, Maria",Mária Škopíková,Mária Škopíková_08573341-75bf-41ab-a68c-fc12ef0dd9e0.jpg -Marián,7,"Cerina, Marian",Marián Cerina,Marián Cerina_50077b5d-b621-4afc-b11e-e4f67435248b.jpg -Marián,0,"Jazbec, Marian",Marián Jazbec,Marián Jazbec_694e645a-3de1-4df1-8eff-c529cdda4fb7.jpg -Mário,4,"Hruska, Mario",Mário Hruška,Mário Hruška_15a68b35-c964-4a39-838a-7a53d0709c0b.jpg -Mark,6,"Quiazon, Mark",Mark Quiazon,Mark Louie Quiazon_2215c656-757b-40ca-802a-239d5e16fbe6.jpg -Marko,0,"Stahovec, Marko",Marko Stahovec,Marko Stahovec_8bd4302a-dbb0-42ae-af7c-79decc1c9032.jpg -Martin,0,"Brisiak, Martin",Martin Brišiak,Martin Brišiak_9e2cc657-5352-430e-b182-6c453ae8101d.jpg -Martin,9,"Janusek, Martin",Martin Janušek,Martin Janušek_a5e1513e-aa79-4043-b2f3-88c0dc6d06ab.jpg -Martin,1,"Komorny, Martin",Martin Komorný,Martin Komorný_171974af-9d73-4fe0-b93b-c7a012d59073.jpg -Martin,0,"Lakatos, Martin",Martin Lakatos,Martin Lakatoš_ab717872-2ebd-4b72-9d8b-148027d64fa6.jpg -Martin,3,"Marko, Martin",Martin Marko,Martin Marko_6960b7ca-769c-40fb-8c31-23dbff7ea718.jpg -Martin,0,"Ondercin, Martin",Martin Onderčin,Martin Onderčin_4c2e0413-3dc3-4923-b329-bdfad332f511.jpg -Martin,1,"Zak, Martin",Martin Žák,Martin Žák_6932653b-362f-4452-bba1-58060334b553.jpg -Martina,1,"Budzinakova, Martina",Martina Budziňáková,Martina Budziňáková_8fafefe2-c081-48be-b3dd-8d1b95dbe7c6.jpg -Máté,12,"Fejes, Mate",Máté Fejes,Máté Fejes_5596ee27-05cf-4eac-9184-22dd79c2abe9.jpg -Matej,6,"Bizik, Matej",Matej Bízik,Matej Bízik_3f5f8b71-a6c7-4ca7-a3ec-71514bad59dd.jpg -Matej,2,"Friedel, Matej",Matej Friedel,Matej Friedel_3da18840-5140-49d9-93fb-a673ab8f21b8.jpg -Matej,0,"Guran, Matej",Matej Guráň,Matej Guráň_1a5c2647-3167-458d-92f6-f3e990146ac3.jpg -Matej,0,"Komlossy, Matej",Matej Komlóssy,Matej Komlóssy_64de6ba2-2e5f-4fb9-b7b8-d3d7f1f79ec6.jpg -Matej,0,"Spisak, Matej",Matej Spišák,Matej Spišák_9b28badf-f3a2-4fe3-8d31-018c4a27be25.jpg -Matúš,2,"Butora, Matus",Matúš Bútora,Matúš Bútora_f8bb29d3-4170-4d3a-9310-31792b875230.jpg -Matúš,3,"Gajdar, Matus",Matúš Gajdár,Matus Gajdar 40750-0-2.jpg -Matúš,0,"Horcik, Matus",Matúš Hôrčik,Matúš Hôrčik_762b52de-c860-43b1-b0d4-ac4342790c11.jpg -Matúš,16,"Kapusta, Matus",Matúš Kapusta,Matúš Kapusta_bf0a8603-f5a2-4d78-9ad1-283130672d99.jpg -Matúš,1,"Malinka, Matus",Matúš Malinka,Matúš Malinka_38ff9998-3019-48ae-b548-c6297c02f672.jpg -Matúš,3,"Michalik, Matus",Matúš Michalík,Matúš Michalík_5d9efde5-490d-4b94-960c-c202cd3bf737.jpg -Matúš,2,"Uhrin, Matus",Matúš Uhrín,Matúš Uhrín_343a75be-efda-4cd2-9984-33c3f30de4c7.jpg -Metod,7,"Rybar, Metod",Metod Rybár,Metod Rybár_0013b60c-b7ef-4d4d-bc33-592b3093bca2.jpg -Michael,0,"Krajanowski, Michael",Michael Krajanowski,Krajanowski Mike_22bfca47-329a-489b-adc3-2f981da99ac4.jpg -Michaela,1,"Cechova, Michaela",Michaela Čechová,Michaela Čechová_bf094293-66c3-4b29-85d3-fb2fec5a8e78.jpg -Michaela,2,"Frankova, Michaela",Michaela Franková,Michaela Franková_40b8fe31-40f4-4710-bbda-21e2b51814e3.jpg -Michaela,2,"Komorova, Michaela",Michaela Komorová,Michaela Komorová_b3e3a260-e0bb-4262-8293-ee22c2fbd759.jpg -Michal,0,"Bujna, Michal",Michal Bujna,Michal Bujna_0fd34e5a-a849-4703-8dd1-10b0744a6684.jpg -Michal,1,"Klco, Michal",Michal Klčo,Michal Klčo 40887-0-2.jpg -Michal,3,"Rohleder, Michal",Michal Rohleder,Michal Rohleder_b9eb0e27-0f60-4555-9279-4da2b5975e07.jpg -Michal,2,"Rychly, Michal",Michal Rychlý,Michal Rychlý_cc675a2f-bf38-4006-b2ef-6358ae6b98d8.jpg -Michal,2,"Stiglic, Michal",Michal Štiglic,Michal Stiglic 40831-0-2.jpg -Michal,5,"Vilagi, Michal",Michal Világi,Michal Világi_67f724f7-81ea-4687-a471-46b7ef4a4d33.jpg -Michal,11,"Zelenak, Michal",Michal Zelenák,Michal Zelenák_915a060e-0b29-49e1-a75a-f0eb74257a45.jpg -Milan,2,"Halabuk, Milan",Milan Halabuk,Milan Halabuk_f34cd64b-a64f-45dd-9db6-dc229049509a.jpg -Milan,0,"Vozarik, Milan",Milan Vozárik,Milan Vozárik_30b39c71-1d82-4e84-b9c7-09b18ec84605.jpg -Mohammed,1,"Saleem, Mohammed",Mohammed Saleem,Raffay Saleem 1663883991704.jpeg -Moises,0,"Silva, Moises",Moises Silva,Moises Silva 40972-0-2.jpg -Monika,0,"Padysakova, Monika",Monika Padyšáková,MonikaPadisakova.jpg -Monika,0,"Starke, Monika",Monika Starke,Monika Starke_4a2b5858-c883-4cd1-b2c0-2aaa96ca4e51.jpg -Myroslav,7,"Nastenko, Myroslav",Myroslav Nastenko,Myroslav Nastenko_8eee8bfd-e41a-4e3e-917c-3e6525a55645.jpg -Oscar,11,"Flores, Oscar",Oscar Flores,Oscar Flores_3f5548c3-9cdb-4b94-82af-650c7f11d58f.jpg -Oskar,0,"Hausknotz, Oskar",Oskar Hausknotz,Oskar Hausknotz_16d22721-dced-4447-9b0b-97ce51f7348b.jpg -Pablo,3,"Borba, Pablo",Pablo Borba,Borba Pablo_b240563c-eb99-44af-9d4f-1f0130e495ba.jpg -Patrik,1,"Mydlar, Patrik",Patrik Mydlár,Patrik Mydlár_2f09b48d-0506-42ba-8f78-7670840d742f.jpg -Patrik,2,"Tomco, Patrik",Patrik Tomčo,Patrik Tomčo_6e1c7ba5-06e2-4e59-85d8-4360a14e26f6.jpg -Pavel,5,"Grunt, Pavel",Pavel Grunt,Pavel Grunt_b12bf052-b765-4c76-9c7c-6bd360a0efb4.jpg -Peter,9,"Drahos, Peter",Peter Drahoš,Peter Drahoš_4f686bb2-3c6d-423b-b398-50fe1b1e4dd7.jpg -Peter,8,"Molcany, Peter",Peter Molčány,Peter Molčány_2615b136-bb7c-47d2-9ab7-c901e6af274a.jpg -Peter,2,"Muzslay, Peter",Peter Muzslay,Peter Muzslay_ad0ad204-57ef-443d-b1cf-6b9b29408233.jpg -Peter,2,"Pokojny, Peter",Peter Pokojný,Peter Pokojný_3ae84c84-14ab-44f8-93d9-83194759206b.jpg -Peter,3,"Poliak, Peter",Peter Poliak,Peter Poliak_4277323d-e330-4ade-9d06-1d32756bf161.jpg -Peter,1,"Rendek, Peter",Peter Rendek,Peter Rendek_3bf4604a-bcc4-42a4-86c7-3eb7a4a4f401.jpg -Peter,3,"Striz, Peter",Peter Stríž,Peter Stríž_49617e60-da63-4db4-98ab-46ea1ff9a12b.jpg -Petr,3,"Chmelar, Petr",Petr Chmelař,Petr Chmelař_71848724-096a-40b1-bba9-dbf97b2a6a0a.jpg -Petr,10,"Duchacek, Petr",Petr Ducháček,Petr Ducháček_e3ac12d8-499e-474b-aa94-d725b1337c21.jpg -Petr,0,"Dvoracek, Petr",Petr Dvořáček,Petr Dvoracek 40974-0-2.jpg -Petr,0,"Hurtik, Petr",Petr Hurtík,Petr Hurtík_d1ddcca2-185c-4ab8-88d9-9b91f6499ce2.jpg -Radek,10,"Benes, Radek",Radek Beneš,Radek Beneš_7e9c6e47-8df5-42e5-a191-040180b80daa.jpg -Radoslav,6,"Cagala, Radoslav",Radoslav Čagala,Radoslav Čagala_11fc81d5-fad4-435d-b356-c57c11282de8.jpg -Ralph,0,"Awika, Ralph",Ralph Awika,Awika Ralph_2a79fdc4-8c8d-4342-a84c-2aeadccac4ba.jpg -Richard,10,"Lunter, Richard",Richard Lunter,Lunter Richard_0f04423a-6ed3-4d80-a586-d82d78564c15.jpg -Richard,0,"Szarka, Richard",Richard Szarka,Richard Szarka_34dab4f2-4c69-44e0-a468-b91f277c1bb1.jpg -Roman,2,"Danko, Roman",Roman Danko,Roman Danko_c4b8b483-55b6-46d2-a855-8920ab6d8fe0.jpg -Ronald,3,"Ruzicka, Ronald",Ronald Ružička,Ronald Ružička_5eb6ecce-5593-4ec0-8074-b8c2e5edf0a6.jpg -Safia,1,"Bagin, Safia",Safia Bagin,Safia Bagin_3f1b2d43-63fa-4b54-8466-8664d8a84beb.jpg -Samuel,7,"Valis, Samuel",Samuel Vališ,Samuel Vališ_d609598b-437c-417f-bf3a-15365034cee1.jpg -Serhii,2,"Viazelenko, Serhii",Serhii Viazelenko,Serhii Viazelenko_77ac87fd-9a1f-4d24-a75e-d38c5795e3ef.jpg -Silvester,1,"Kosmel, Silvester",Silvester Kosmeľ,Silvester Kosmeľ_acd8e7e9-8450-4bfc-81e2-2a05cea6f66e.jpg -Silvester,0,"Pullman, Silvester",Silvester Pullman,Silvester Pullman_94c80531-53d8-4814-abcb-d69dfac7a996.jpg -Šimon,0,"Kostolny, Simon",Šimon Kostolný,Šimon Kostolný_f181b548-31cb-4fd4-827f-2400bd8e32ab.jpg -Soňa,0,"Babjakova, Sona",Soňa Babjaková,Soňa Babjaková_133d59df-ca3f-472a-a7f2-5169eb2c7c88.jpg -Stanislav,0,"Benaci, Stanislav",Stanislav Benáci,Stanislav Benáci_42a69bd8-ae4c-4eac-a58d-a2ba268fe362.jpg -Stanislav,4,"Orsula, Stanislav",Stanislav Oršula,Stanislav Oršula_5b5c1514-4b6a-44fd-aee4-038bb0f48d56.jpg -Štefan,6,"Bellus, Stefan",Štefan Bellus,Štefan Bellus_81dc68a8-a424-40b0-baaf-e24020d490e9.jpg -Štěpán,6,"Lendak, Stepan",Štěpán Lenďák,Štěpán Lenďák_d710d91b-f2df-421d-a3fa-1d0e7b03c694.jpg -Tatjana,2,"Piksiades, Tatjana",Tatjana Piksiades,Tatjana Piksiades_3ff1e195-eaa0-4208-9618-e076fa3b345a.jpg -Thiago,2,"Prado, Thiago",Thiago Prado,Thiago Prado_e74ae19e-ba9d-43cf-b309-b4139487ad3d.jpg -Tomáš,11,"Antolik, Tomas",Tomáš Antolík,Tomáš Antolík_ad2929d9-15e7-4e68-aff3-45c2345d17fe.jpg -Tomáš,2,"Bittsansky, Tomas",Tomáš Bittšánsky,Tomáš Bittšánsky_49d103e5-d408-4565-b12f-37b64c3697bd.jpg -Tomáš,4,"Krupa, Tomas",Tomáš Krupa,Tomáš Krupa_7bbb1cfc-c5da-498b-b90d-c52aaa21ee9b.jpg -Tomáš,2,"Lasak, Tomas",Tomáš Lasak,Tomáš Lasak_d50d2de7-a979-4a9a-a09e-7973ab702d99.jpg -Tomáš,2,"Muzika, Tomas",Tomáš Mužika,Tomáš Mužika_7bcebe22-a86a-45eb-bbd3-8899b3fbf2a8.jpg -Tomas,11,"Pribyl, Tomas",Tomáš Přibyl,Tomas Pribyl 40564-1-2.jpg -Tomáš,1,"Repak, Tomas",Tomáš Repák,Tomas Repak 40913-0-2.jpg -Tomáš,1,"Venkrbec, Tomas",Tomáš Venkrbec,Tomáš Venkrbec_310f8370-9eb6-4d35-8f4f-56d7150c8658.jpg -Václav,3,"Stransky, Vaclav",Václav Stránský,Václav Stránský_77b8bed4-8724-4045-950e-87fc1d9cb7bb.jpg -Vanda,5,"Dodokova, Vanda",Vanda Dodoková,Vanda Dodoková_7c6b3072-f915-4bc1-bdff-b4f8bfda2847.jpg -Veronika,3,"Polakova, Veronika",Veronika Poláková,Veronika Poláková_27b3e229-cfa5-4d81-97e3-fe18a44a9a80.jpg -Viktor,3,"Bielko, Viktor",Viktor Bielko,Viktor Bielko_6a2ddb7b-a9fb-4fca-a755-f80e82be24dd.jpg -Viktor,2,"Molnar, Viktor",Viktor Molnár,Viktor Molnár_25e49c67-1e85-41bf-926d-25ccda00f277.jpg -Viktoria,7,"Matunakova, Viktoria",Viktória Matunáková,Viktória Matunáková_ff9e82b7-31c8-4060-ae20-edf724d9e343.jpg -Vladimír,18,"Kostiviar, Vladimir",Vladimír Kostiviar,Vlado Kostiviar_f9eaad98-0ca6-4f9e-9283-cf8d4bae0940.jpg -Yevhenii,1,"Kurinov, Yevhenii",Yevhenii Kurinov,Yevhenii Kurinov_5e8bf51a-2088-47a9-bb88-b9a1657c2fc9.jpg -Vojta,3,"Diatka, Vojta",Vojta Diatka,Vojta Diatka_db50703a-0482-479f-ac03-128674bca9f2.jpg -Jakub,4,"Supa, Jakub",Jakub Šupa,Jakub Šupa_38f625d1-6586-4c23-823d-b43fd73d05ba.jpg -Tereza,5,"Cerina, Tereza",Tereza Cerina,Tereza Cerina_9202b4f3-cea1-4474-84ce-6cdf4cbc02b4.jpg From 8b564ce2aa39d879bb3b82870f58d07b89590ca3 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Wed, 30 Oct 2024 08:23:06 +0100 Subject: [PATCH 03/11] initial seed --- .../{gatheringScript/getUsers.py => get_users.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/scripts/migrate-watchlist-members/{gatheringScript/getUsers.py => get_users.py} (100%) diff --git a/src/scripts/migrate-watchlist-members/gatheringScript/getUsers.py b/src/scripts/migrate-watchlist-members/get_users.py similarity index 100% rename from src/scripts/migrate-watchlist-members/gatheringScript/getUsers.py rename to src/scripts/migrate-watchlist-members/get_users.py From 46d1aa9fb530b45cb557b04605cc14a419139242 Mon Sep 17 00:00:00 2001 From: Juraj Date: Wed, 30 Oct 2024 08:43:43 +0100 Subject: [PATCH 04/11] Updated, able to gather and to seed watchlist members --- src/AEOS/AeosSync/README.md | 27 ++-- src/AEOS/AeosSync/appsettings.json | 14 +- .../getImagesScript/getImages.py | 140 ------------------ .../seedDatabase.py => seed_database.py} | 82 ++++------ .../seedingScript/removeUsers.ps1 | 20 --- 5 files changed, 56 insertions(+), 227 deletions(-) delete mode 100644 src/scripts/migrate-watchlist-members/getImagesScript/getImages.py rename src/scripts/migrate-watchlist-members/{seedingScript/seedDatabase.py => seed_database.py} (55%) delete mode 100644 src/scripts/migrate-watchlist-members/seedingScript/removeUsers.ps1 diff --git a/src/AEOS/AeosSync/README.md b/src/AEOS/AeosSync/README.md index 43f44f6..1f278d6 100644 --- a/src/AEOS/AeosSync/README.md +++ b/src/AEOS/AeosSync/README.md @@ -3,32 +3,34 @@ # SF to AeosSync Adapter This application connects to the SmartFace AccessController gRPC stream, processes `GRANTED` notifications and sends `Open` requests to AeosSync Server -## Development +## Running To run the application locally, follow these steps - open terminal - navigate to /src/AeosSync - run `dotnet run` - ## Deployment +## Deployment To deploy the application, follow these steps - open terminal - navigate to /src/AeosSync - run `dotnet publish -c Release -r win10-x64 --self-contained true -p:ReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=false -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true` + + ### Deploy to Docker - navigate to the root of this repo - run the following commands - - `docker build -f src/AEOS/AeosSync/Dockerfile -t registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.5 .` - - `docker tag registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.5 registry.gitlab.com/innovatrics/smartface/integrations-aeossync:latest` - - `docker push registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.5` + - `docker build -f src/AEOS/AeosSync/Dockerfile -t registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.6 .` + - `docker tag registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.6 registry.gitlab.com/innovatrics/smartface/integrations-aeossync:latest` + - `docker push registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.6` - `docker push registry.gitlab.com/innovatrics/smartface/integrations-aeossync:latest` ### Deploy to Docker on Arm - navigate to the root of this repo - run the following commands - - `docker build -f src/AEOS/AeosSync/arm.Dockerfile -t registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.5-arm .` - - `docker tag registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.5-arm registry.gitlab.com/innovatrics/smartface/integrations-aeossync:latest-arm` - - `docker push registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.5-arm` + - `docker build -f src/AEOS/AeosSync/arm.Dockerfile -t registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.6-arm .` + - `docker tag registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.6-arm registry.gitlab.com/innovatrics/smartface/integrations-aeossync:latest-arm` + - `docker push registry.gitlab.com/innovatrics/smartface/integrations-aeossync:0.6-arm` - `docker push registry.gitlab.com/innovatrics/smartface/integrations-aeossync:latest-arm` ## Usage @@ -57,4 +59,11 @@ networks: external: name: sf-network -``` \ No newline at end of file +``` + +## Update references + +### SOAP +`dotnet tool install --global dotnet-svcutil` +`dotnet-svcutil --roll-forward LatestMajor https://:8443/aeosws?wsdl` + diff --git a/src/AEOS/AeosSync/appsettings.json b/src/AEOS/AeosSync/appsettings.json index 0965366..c70e554 100644 --- a/src/AEOS/AeosSync/appsettings.json +++ b/src/AEOS/AeosSync/appsettings.json @@ -22,11 +22,11 @@ "SmartFace": { "FirstNameOrder": "last", "RestApi": { - "ServerUrl": "", + "ServerUrl": "http://192.168.17.20:8098", "PageSize": 100 }, "GraphQL": { - "ServerUrl": "", + "ServerUrl": "http://192.168.17.20:8097/graphql/", "PageSize": 100 }, "Export": { @@ -48,10 +48,10 @@ }, "Aeos": { "Server": { - "Wsdl": "", + "Wdsl": "https://192.168.17.10:8443/aeosws?wsdl", "PageSize": 100, - "User": "", - "Pass": "" + "User": "admin", + "Pass": "Smartface123" }, "Integration": { "Freefield": "SmartFaceId", @@ -59,13 +59,11 @@ "BiometricEnrollmentStatus": "BiometricEnrollmentStatus", "SmartFaceKeepUser": "SmartFaceKeepUser", "DefaultTemplates": { - "7thFloorTemplateClaimablePermanent": true, - "6thFloorTemplateClaimablePermanent": true } }, "NoImageWarningNotification":false, "AutoBiometryEnablement":true, - "AutoBiometryPrefix":"", + "AutoBiometryPrefix":"aeos_", "KeepPhotoUpToDate":true } diff --git a/src/scripts/migrate-watchlist-members/getImagesScript/getImages.py b/src/scripts/migrate-watchlist-members/getImagesScript/getImages.py deleted file mode 100644 index 3b541f5..0000000 --- a/src/scripts/migrate-watchlist-members/getImagesScript/getImages.py +++ /dev/null @@ -1,140 +0,0 @@ -import requests -import os -import re # Make sure to import the re module for regular expressions - -def sanitize_filename(filename): - """Replace invalid characters in the filename.""" - return re.sub(r'[<>:"/\\|?*]', '_', filename) - -def apply_curl_to_items(api_url, image_data_ids, save_to_folder): - print("Downloading images:") - #print(image_data_ids) - - for image_id, full_name, display_name, createdAt in image_data_ids: - url = f"{api_url}/{image_id}" - headers = {"accept": "image/jpeg"} - - try: - response = requests.get(url, headers=headers) - - # Check if the request was successful (status code 200) - if response.status_code == 200: - - # Sanitize the createdAt timestamp - sanitized_createdAt = sanitize_filename(createdAt) - - # Save the image data to a file in the specified folder - file_name = full_name if full_name else display_name - file_path = os.path.join(save_to_folder, f"{sanitized_createdAt}_{file_name}_{image_id}.jpg") - with open(file_path, "wb") as file: - file.write(response.content) - print(f"Image saved: {file_path}") - else: - print(f"Failed to retrieve image with id: {image_id}, Status code: {response.status_code}") - - except requests.exceptions.RequestException as e: - print(f"An error occurred while processing image with id: {image_id}, Error: {e}") - - -if __name__ == '__main__': - api_url = 'http://192.168.101.10:8098/api/v1/Images' # Replace with the actual API endpoint for image retrieval - save_to_folder = "./images/" - - # GraphQL endpoint URL - graphql_url = "http://192.168.101.10:8097/graphql/" - - # GraphQL query - query = """ - query($skip: Int!, $take: Int!) - { - matchResults( - skip: $skip, take: $take, order: {createdAt: ASC}, - where: { - createdAt: {gte: "2024-09-25T09:00:00.000Z"} - } - ) - - { # Add skip and take here - items { - createdAt - watchlistMemberFullName - watchlistMemberDisplayName - faceId - frameId - faceOrder - age - gender - frame { - id - imageDataId - } - } - totalCount - pageInfo { - hasNextPage - hasPreviousPage - } - } - } - """ - - take = 100 # Number of items to fetch per request - skip = 0 # Starting point for each batch - has_more_data = True - all_data = [] - image_data_ids = [] # Initialize this at a higher scope so it can be used later - - # Set up headers for the request - headers = { - "Content-Type": "application/json", - } - - image_data_ids = [] - while has_more_data: - # Set up the variables for the GraphQL query - variables = { - "skip": skip, - "take": take - } - - try: - # Make the GraphQL request with variables - response = requests.post(graphql_url, json={"query": query, "variables": variables}, headers=headers) - response.raise_for_status() # Check for HTTP errors - data = response.json() - - if "errors" in data: - print(f"Error: {data['errors']}") - break - - # Update skip for the next batch - skip += take - - # Extract imageDataId values - - totalCount = data["data"]["matchResults"]["totalCount"] - for item in data["data"]["matchResults"]["items"]: - createdAt = item["createdAt"] - fullname = item["watchlistMemberFullName"] - displayname = item["watchlistMemberDisplayName"] - frameImageId = item["frame"]["imageDataId"] - image_data_ids.append((frameImageId, fullname, displayname, createdAt)) - - print(frameImageId, fullname, displayname, createdAt) - - # Check if we've fetched all items - if skip >= totalCount: - has_more_data = False - - except requests.exceptions.RequestException as e: - print("An error occurred:", e) - print("Response content:", response.content) - break - - #After fetching all the data, call apply_curl_to_items to download images - if image_data_ids: - try: - apply_curl_to_items(api_url, image_data_ids, save_to_folder) - except requests.exceptions.RequestException as e: - print("Error while downloading an image:", e) - print("Response content:", response.content) diff --git a/src/scripts/migrate-watchlist-members/seedingScript/seedDatabase.py b/src/scripts/migrate-watchlist-members/seed_database.py similarity index 55% rename from src/scripts/migrate-watchlist-members/seedingScript/seedDatabase.py rename to src/scripts/migrate-watchlist-members/seed_database.py index 35c1b30..461d1de 100644 --- a/src/scripts/migrate-watchlist-members/seedingScript/seedDatabase.py +++ b/src/scripts/migrate-watchlist-members/seed_database.py @@ -1,4 +1,3 @@ -import csv import requests import json import base64 @@ -14,21 +13,18 @@ failedData = [] # Function to read and encode image as base64 -def get_image_base64(image_filename): - # Construct the full path to the image file - image_path = os.path.join(IMAGE_FOLDER, image_filename) - +def get_image_base64(image_path): try: # Read the image file and encode it to base64 with open(image_path, "rb") as image_file: encoded_string = base64.b64encode(image_file.read()).decode('utf-8') return encoded_string except FileNotFoundError: - print(f"Image file '{image_filename}' not found.") + print(f"Image file '{image_path}' not found.") return "" # Function to send POST request to the API -def send_data_to_api(name, full_name, note, image_data, years,recordnumber): +def send_data_to_api(name, image_data, recordnumber): global countSuccess global countFailed global failedData @@ -55,13 +51,8 @@ def send_data_to_api(name, full_name, note, image_data, years,recordnumber): "keepAutoLearnPhotos": False, "displayName": name, "fullName": name, - "note": years, - "labels": [{ - - "key": "years", - "value": years - } - ] + "note": "", + "labels": [] } headers = {'Content-Type': 'application/json'} @@ -70,48 +61,42 @@ def send_data_to_api(name, full_name, note, image_data, years,recordnumber): response = requests.post(API_ENDPOINT, headers=headers, data=json.dumps(payload)) if response.status_code == 201: - print(f"Success: {note} data sent.") + print(f"Success: {name} data sent.") countSuccess += 1 else: - failedMessage = f"Failed to send data for {note}. Status code: {response.status_code}, Response: {response.text}" + failedMessage = f"Failed to send data for {name}. Status code: {response.status_code}, Response: {response.text}" print(failedMessage) countFailed += 1 failedData.append({ - 'name': note, + 'name': name, 'status': response.status_code, 'response': response.text }) -# Function to read CSV and process data -def process_csv_and_send_data(csv_file_path): - with open(csv_file_path, mode='r', encoding='utf-8-sig') as file: - csv_reader = csv.DictReader(file, quotechar='"') - - # Print the headers to check if they are correct - headers = csv_reader.fieldnames - print("CSV Headers:", headers) # This will show what headers are actually being recognized +# Function to process images and send data +def process_images_and_send_data(): + recordnumber = 1 + + for image_filename in os.listdir(IMAGE_FOLDER): + # Ensure we are only processing image files + if not image_filename.lower().endswith(('.png', '.jpg', '.jpeg', '.jfif')): + continue - recordnumber = 1 + image_path = os.path.join(IMAGE_FOLDER, image_filename) - for row in csv_reader: - # Check if the 'Name' column exists - if 'Name' not in row: - print("Error: 'Name' column not found in the CSV. Check the headers.") - return # Stop the script if 'Name' column is missing - - # Extract relevant data from CSV - name = row['Name'] - note = row['Name and Surname'] - image_file = row['Images'] # Get the image filename from the 'Images' column - years = row['Years'] - - # Encode the image to base64 - image_data = get_image_base64(image_file) if image_file else "" + # Use the first part of the filename before any underscore as the name + filename_without_ext = os.path.splitext(image_filename)[0] + name = filename_without_ext.split('_')[0] # Take only the part before the first underscore - # Call API with the extracted data - send_data_to_api(name, name, note, image_data, years, recordnumber) - recordnumber += 1 + # Encode the image to base64 + image_data = get_image_base64(image_path) + # Call API with the image data + send_data_to_api(name, image_data, recordnumber) + recordnumber += 1 + + +# Function to log failed data def log_failed_data(log_file_path, failed_data): # Open the log file in append mode with open(log_file_path, 'a', encoding='utf-8') as log_file: @@ -125,18 +110,15 @@ def log_failed_data(log_file_path, failed_data): log_file.write(f"Response: {fail['response']}\n") log_file.write("\n") # Add a newline to separate entries -# Specify the path to your CSV file -csv_file_path = r'c:\Users\jberes\Documents\work\Projects\2024\20th-Anniversary\scripts\seedingScript\employees_v01.csv' - -# Process CSV and send data -process_csv_and_send_data(csv_file_path) +# Process images and send data +process_images_and_send_data() # Example usage after processing all data log_file_path = 'failed_data_log.txt' -# Call the logging function after your CSV processing is done +# Call the logging function after image processing is done if failedData: log_failed_data(log_file_path, failedData) print(f"Total Success: {countSuccess}") -print(f"Total Failed: {countFailed}") \ No newline at end of file +print(f"Total Failed: {countFailed}") diff --git a/src/scripts/migrate-watchlist-members/seedingScript/removeUsers.ps1 b/src/scripts/migrate-watchlist-members/seedingScript/removeUsers.ps1 deleted file mode 100644 index 73ba23b..0000000 --- a/src/scripts/migrate-watchlist-members/seedingScript/removeUsers.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -Invoke-RestMethod -ContentType "application/json" -Method Post -Uri http://sface-integ-2u:8097/graphql/ -Body (@{variables = $null; query = ` -'query { - watchlistMembers(take: 1000) { - items { - fullName - displayName - id - - - } - } -}'} | ConvertTo-Json) | ` -Select-Object -ExpandProperty data | ` -Select-Object -ExpandProperty watchlistMembers | ` -Select-Object -ExpandProperty items | ` -ForEach-Object { - -Invoke-RestMethod -Method Delete -Uri http://sface-integ-2u:8098/api/v1/WatchlistMembers/$($_.id) -Write-Host "$($_.id) $($_.fullName) $($_.displayName)" -} \ No newline at end of file From e8ebcd171bdf014459f2d1044000cf62836e32bf Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Wed, 30 Oct 2024 14:58:45 +0100 Subject: [PATCH 05/11] initial seed --- .gitignore | 3 ++- .../migrate-watchlist-members/seed_database.py | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ea0bd8c..e9b91e8 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,5 @@ Output/ [Oo]utput/ [Pp]ublish/ -src/GrpcCamera/stream-out/* \ No newline at end of file +src/GrpcCamera/stream-out/* +src/scripts/migrate-watchlist-members/images/* diff --git a/src/scripts/migrate-watchlist-members/seed_database.py b/src/scripts/migrate-watchlist-members/seed_database.py index 461d1de..8fbafe5 100644 --- a/src/scripts/migrate-watchlist-members/seed_database.py +++ b/src/scripts/migrate-watchlist-members/seed_database.py @@ -4,8 +4,8 @@ import os # Define the API endpoint -API_ENDPOINT = "http://sface-integ-2u:8098/api/v1/WatchlistMembers/Register" -WATCHLIST_ID = "13d80d4b-f512-46ca-9d36-3732fd615f04" +API_ENDPOINT = "https://api.guard.smartfacecloud.com/api/v1/WatchlistMembers/Register" +WATCHLIST_ID = "0d3b0376-b94a-4195-bbce-980ee2e61a67" IMAGE_FOLDER = "images" # Folder where images are stored countSuccess = 0 @@ -46,6 +46,7 @@ def send_data_to_api(name, image_data, recordnumber): "maxFaces": 20, "confidenceThreshold": 300 }, + "faceValidationMode": "none", "faceDetectorResourceId": "cpu", "templateGeneratorResourceId": "cpu", "keepAutoLearnPhotos": False, @@ -55,8 +56,12 @@ def send_data_to_api(name, image_data, recordnumber): "labels": [] } - headers = {'Content-Type': 'application/json'} - + + headers = { + "Content-Type": "application/json", + "Authorization": "Bearer eyJhbGciOiJSUz..." + } + # Sending the POST request to the API response = requests.post(API_ENDPOINT, headers=headers, data=json.dumps(payload)) From adb943479602ff73d60277544f62e221d7bd5529 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Tue, 26 Nov 2024 09:56:47 +0100 Subject: [PATCH 06/11] Merge remote-tracking branch 'origin/master' into feature/scripts/migrate-watchlist-members --- .vscode/launch.json | 4 +- .vscode/tasks.json | 6 +- .../GraphQlNotificationSource.cs | 68 +++++++++++------- src/AutoEnrollment/Program.cs | 2 +- .../Service/AutoEnrollmentService.cs | 12 ++-- .../SmartFace.AutoEnrollment.csproj | 70 ++++++++++--------- 6 files changed, 90 insertions(+), 72 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index a3a5ae2..bc440db 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,9 +10,9 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/src/scripts/CompareFilesInFolder/bin/Debug/net6.0/CompareFilesInFolder.dll", + "program": "${workspaceFolder}/src/AutoEnrollment/bin/Debug/net6.0/SmartFace.AutoEnrollment.dll", "args": [], - "cwd": "${workspaceFolder}/src/scripts/CompareFilesInFolder", + "cwd": "${workspaceFolder}/src/AutoEnrollment", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", "stopAtEntry": false diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2b3e5f1..57639a9 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,7 +7,7 @@ "type": "process", "args": [ "build", - "${workspaceFolder}/src/AEOSSyncTool/AEOSSyncTool.csproj", + "${workspaceFolder}/src/AutoEnrollment/AutoEnrollment.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], @@ -19,7 +19,7 @@ "type": "process", "args": [ "publish", - "${workspaceFolder}/src/AEOSSyncTool/AEOSSyncTool.csproj", + "${workspaceFolder}/src/AutoEnrollment/AutoEnrollment.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], @@ -33,7 +33,7 @@ "watch", "run", "--project", - "${workspaceFolder}/src/AEOSSyncTool/AEOSSyncTool.csproj" + "${workspaceFolder}/src/AutoEnrollment/AutoEnrollment.csproj" ], "problemMatcher": "$msCompile" } diff --git a/src/AutoEnrollment/NotificationReceivers/GraphQlNotificationSource.cs b/src/AutoEnrollment/NotificationReceivers/GraphQlNotificationSource.cs index 6c91e1c..949feac 100644 --- a/src/AutoEnrollment/NotificationReceivers/GraphQlNotificationSource.cs +++ b/src/AutoEnrollment/NotificationReceivers/GraphQlNotificationSource.cs @@ -132,46 +132,60 @@ private async Task StartReceivingGraphQlNotifications() }; var _subscriptionStream = _graphQlClient.CreateSubscriptionStream( - _graphQLRequest, ex => + _graphQLRequest, + ex => { _logger.Error(ex, "GraphQL subscription init error"); }); - _subscription = _subscriptionStream.Subscribe(response => + _subscription = _subscriptionStream.Subscribe( + onNext: response => { - _logger.Information("IdentificationEvent received for stream {Stream} and tracklet {Tracklet}", - response.Data.IdentificationEvent?.StreamInformation?.StreamId, response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.TrackletId); - - var notification = new Notification + if (response.Data != null) { - StreamId = response.Data.IdentificationEvent?.StreamInformation?.StreamId, - FaceId = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.Id, - TrackletId = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.TrackletId, - CropImage = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.CropImage, + _logger.Information("IdentificationEvent received for stream {Stream} and tracklet {Tracklet}", + response.Data.IdentificationEvent?.StreamInformation?.StreamId, response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.TrackletId); + + var notification = new Notification + { + StreamId = response.Data.IdentificationEvent?.StreamInformation?.StreamId, + FaceId = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.Id, + TrackletId = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.TrackletId, + CropImage = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.CropImage, - FrameInformation = response.Data.IdentificationEvent?.FrameInformation, - CropCoordinates = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.CropCoordinates, + FrameInformation = response.Data.IdentificationEvent?.FrameInformation, + CropCoordinates = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.CropCoordinates, - FaceQuality = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FaceQuality, - TemplateQuality = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.TemplateQuality, + FaceQuality = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FaceQuality, + TemplateQuality = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.TemplateQuality, - FaceArea = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FaceArea, - FaceSize = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FaceSize, - FaceOrder = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FaceOrder, - FacesOnFrameCount = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FacesOnFrameCount, + FaceArea = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FaceArea, + FaceSize = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FaceSize, + FaceOrder = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FaceOrder, + FacesOnFrameCount = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.FacesOnFrameCount, - Brightness = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.Brightness, - Sharpness = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.Sharpness, + Brightness = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.Brightness, + Sharpness = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.Sharpness, - PitchAngle = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.PitchAngle, - RollAngle = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.RollAngle, - YawAngle = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.YawAngle, + PitchAngle = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.PitchAngle, + RollAngle = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.RollAngle, + YawAngle = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.YawAngle, - OriginProcessedAt = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.ProcessedAt, - ReceivedAt = DateTime.UtcNow - }; + OriginProcessedAt = response.Data.IdentificationEvent?.FaceModalityInfo?.FaceInformation?.ProcessedAt, + ReceivedAt = DateTime.UtcNow + }; - OnNotification?.Invoke(notification); + OnNotification?.Invoke(notification); + } + else if (response.Errors != null && response.Errors.Length > 0) + { + _logger.Information("{{errors}} errors from GraphQL received", response.Errors.Length); + + foreach (var e in response.Errors) + { + _logger.Information("Error: {{error}}", e.Message); + } + } }, onError: err => { diff --git a/src/AutoEnrollment/Program.cs b/src/AutoEnrollment/Program.cs index 6de8006..837174f 100644 --- a/src/AutoEnrollment/Program.cs +++ b/src/AutoEnrollment/Program.cs @@ -90,7 +90,7 @@ private static void ConfigureServices(IServiceCollection services, ILogger logge private static IConfigurationRoot ConfigureBuilder(string[] args) { return new ConfigurationBuilder() - .SetMainModuleBasePath() + // .SetMainModuleBasePath() .AddJsonFile(JsonConfigFileName, optional: false) .AddEnvironmentVariables() .AddCommandLine(args) diff --git a/src/AutoEnrollment/Service/AutoEnrollmentService.cs b/src/AutoEnrollment/Service/AutoEnrollmentService.cs index 77a8496..6ce7b7e 100644 --- a/src/AutoEnrollment/Service/AutoEnrollmentService.cs +++ b/src/AutoEnrollment/Service/AutoEnrollmentService.cs @@ -48,12 +48,12 @@ public AutoEnrollmentService( var config = configuration.GetSection("Config").Get(); - _debugOutputFolder = config.DebugOutputFolder; - MaxParallelBlocks = config.MaxParallelActionBlocks ?? 4; - DetectorMaxFaces = config.RegisterMaxFaces ?? 3; - DetectorMinFaceSize = config.RegisterMinFaceSize ?? 30; - DetectorMaxFaceSize = config.RegisterMaxFaceSize ?? 600; - DetectorFaceConfidence = config.RegisterFaceConfidence ?? 450; + _debugOutputFolder = config?.DebugOutputFolder; + MaxParallelBlocks = config?.MaxParallelActionBlocks ?? 4; + DetectorMaxFaces = config?.RegisterMaxFaces ?? 3; + DetectorMinFaceSize = config?.RegisterMinFaceSize ?? 30; + DetectorMaxFaceSize = config?.RegisterMaxFaceSize ?? 600; + DetectorFaceConfidence = config?.RegisterFaceConfidence ?? 450; } public void Start() diff --git a/src/AutoEnrollment/SmartFace.AutoEnrollment.csproj b/src/AutoEnrollment/SmartFace.AutoEnrollment.csproj index 1f7dff5..417d56f 100644 --- a/src/AutoEnrollment/SmartFace.AutoEnrollment.csproj +++ b/src/AutoEnrollment/SmartFace.AutoEnrollment.csproj @@ -1,40 +1,44 @@  - - Exe - net6.0 - + + Exe + net6.0 + - - - - + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - PreserveNewest - true - PreserveNewest - - + + + PreserveNewest + + + + \ No newline at end of file From afff07051e625418b9577fa093842454c8dd1017 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Tue, 26 Nov 2024 10:12:38 +0100 Subject: [PATCH 07/11] Merge remote-tracking branch 'origin/master' into feature/scripts/migrate-watchlist-members --- .../NotificationReceivers/GraphQlNotificationSource.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AutoEnrollment/NotificationReceivers/GraphQlNotificationSource.cs b/src/AutoEnrollment/NotificationReceivers/GraphQlNotificationSource.cs index 949feac..a41f636 100644 --- a/src/AutoEnrollment/NotificationReceivers/GraphQlNotificationSource.cs +++ b/src/AutoEnrollment/NotificationReceivers/GraphQlNotificationSource.cs @@ -179,11 +179,11 @@ private async Task StartReceivingGraphQlNotifications() } else if (response.Errors != null && response.Errors.Length > 0) { - _logger.Information("{{errors}} errors from GraphQL received", response.Errors.Length); + _logger.Information("{errors} errors from GraphQL received", response.Errors.Length); foreach (var e in response.Errors) { - _logger.Information("Error: {{error}}", e.Message); + _logger.Error("{error}", e.Message); } } }, From 3525588c76fdd878bed15f577397227711d4d370 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Tue, 26 Nov 2024 10:13:15 +0100 Subject: [PATCH 08/11] Merge remote-tracking branch 'origin/master' into feature/scripts/migrate-watchlist-members --- src/AutoEnrollment/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AutoEnrollment/README.md b/src/AutoEnrollment/README.md index b6f9236..0b2c09f 100644 --- a/src/AutoEnrollment/README.md +++ b/src/AutoEnrollment/README.md @@ -16,9 +16,9 @@ To run application localy, follow these steps ### Deploy to Docker - navigate to root of this repo - run following commands - - `docker build -f src/AutoEnrollment/Dockerfile -t registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:0.2.9 .` - - `docker tag registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:0.2.9 registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:latest` - - `docker push registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:0.2.9` + - `docker build -f src/AutoEnrollment/Dockerfile -t registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:0.2.10 .` + - `docker tag registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:0.2.10 registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:latest` + - `docker push registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:0.2.10` - `docker push registry.gitlab.com/innovatrics/smartface/integrations-auto-enroll:latest` ## Usage From defb7d5efa6f836874eff26c866272976815c172 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Tue, 26 Nov 2024 10:14:14 +0100 Subject: [PATCH 09/11] Merge remote-tracking branch 'origin/master' into feature/scripts/migrate-watchlist-members --- src/AEOS/AeosSync/appsettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AEOS/AeosSync/appsettings.json b/src/AEOS/AeosSync/appsettings.json index c70e554..2985542 100644 --- a/src/AEOS/AeosSync/appsettings.json +++ b/src/AEOS/AeosSync/appsettings.json @@ -48,10 +48,10 @@ }, "Aeos": { "Server": { - "Wdsl": "https://192.168.17.10:8443/aeosws?wsdl", + "Wdsl": "https://192.168.1.10:8443/aeosws?wsdl", "PageSize": 100, "User": "admin", - "Pass": "Smartface123" + "Pass": "" }, "Integration": { "Freefield": "SmartFaceId", From b69a8079e17ba01c8f28cc8c4c32b54e1c8f20e9 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Tue, 26 Nov 2024 10:14:41 +0100 Subject: [PATCH 10/11] Merge remote-tracking branch 'origin/master' into feature/scripts/migrate-watchlist-members --- src/MyQConnector/appsettings.json | 2 +- src/scripts/migrate-watchlist-members/get_users.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MyQConnector/appsettings.json b/src/MyQConnector/appsettings.json index 49ab127..029adb9 100644 --- a/src/MyQConnector/appsettings.json +++ b/src/MyQConnector/appsettings.json @@ -20,7 +20,7 @@ }, "AccessController": { "Schema": "http", - "Host": "10.11.64.67", + "Host": "192.168.1.11", "Port": 5050 }, diff --git a/src/scripts/migrate-watchlist-members/get_users.py b/src/scripts/migrate-watchlist-members/get_users.py index 4251fac..e1da419 100644 --- a/src/scripts/migrate-watchlist-members/get_users.py +++ b/src/scripts/migrate-watchlist-members/get_users.py @@ -42,11 +42,11 @@ def apply_curl_to_items(api_url, image_data_ids, save_to_folder): if __name__ == '__main__': - api_url = 'http://10.11.64.18:8098/api/v1/Images' # Replace with the actual API endpoint for image retrieval + api_url = 'http://192.168.1.11:8098/api/v1/Images' # Replace with the actual API endpoint for image retrieval save_to_folder = "./images/" # GraphQL endpoint URL - graphql_url = "http://10.11.64.18:8097/graphql/" + graphql_url = "http://192.168.1.11:8097/graphql/" # GraphQL query query = """ From 2752ee49ca6cda9887d0fbdf12b70ad3dc0352b7 Mon Sep 17 00:00:00 2001 From: Lukas Malik Date: Tue, 26 Nov 2024 10:35:40 +0100 Subject: [PATCH 11/11] Merge remote-tracking branch 'origin/master' into feature/scripts/migrate-watchlist-members --- src/AutoEnrollment/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AutoEnrollment/Program.cs b/src/AutoEnrollment/Program.cs index 837174f..6de8006 100644 --- a/src/AutoEnrollment/Program.cs +++ b/src/AutoEnrollment/Program.cs @@ -90,7 +90,7 @@ private static void ConfigureServices(IServiceCollection services, ILogger logge private static IConfigurationRoot ConfigureBuilder(string[] args) { return new ConfigurationBuilder() - // .SetMainModuleBasePath() + .SetMainModuleBasePath() .AddJsonFile(JsonConfigFileName, optional: false) .AddEnvironmentVariables() .AddCommandLine(args)