diff --git a/scripts/dataset/artificialDataset.py b/scripts/dataset/artificialDataset.py index cf944c9..01f5026 100755 --- a/scripts/dataset/artificialDataset.py +++ b/scripts/dataset/artificialDataset.py @@ -13,9 +13,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # artificialDataset, RecognitionMemory and each script in this project is under the GNU General Public # # License. # diff --git a/scripts/dataset/imdb_face_crossval_extraction.m b/scripts/dataset/imdb_face_crossval_extraction.m index 7eb758b..20d18c6 100755 --- a/scripts/dataset/imdb_face_crossval_extraction.m +++ b/scripts/dataset/imdb_face_crossval_extraction.m @@ -9,9 +9,8 @@ % images in the dataset. % % % % Please cite the following work if using this code: % -% B. Irfan, N. Lyubova, M. Garcia Ortiz, and T. Belpaeme (2018), 'Multi-modal Open-Set Person % -% Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social % -% Robots in the Wild workshop. % +% B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User % +% Identification', ACM Transactions on Human-Robot Interaction (THRI). % % % % * Face cropped images of IMDB dataset in IMDB-Wiki dataset are used for this purpose: % % R. Rothe and R. Timofte and L. Van Gool (2016), 'Deep expectation of real and apparent age from a % diff --git a/scripts/dataset/imdb_prepareImages.py b/scripts/dataset/imdb_prepareImages.py index 8342532..ace6382 100755 --- a/scripts/dataset/imdb_prepareImages.py +++ b/scripts/dataset/imdb_prepareImages.py @@ -17,9 +17,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # * Face cropped images of IMDB dataset in IMDB-Wiki dataset are used for this purpose: # # R. Rothe and R. Timofte and L. Van Gool (2016), 'Deep expectation of real and apparent age from a # diff --git a/scripts/dataset/mmltur.py b/scripts/dataset/mmltur.py index f12bc57..6a157b0 100644 --- a/scripts/dataset/mmltur.py +++ b/scripts/dataset/mmltur.py @@ -1,3 +1,20 @@ +# coding: utf-8 + +#! /usr/bin/env python + +#========================================================================================================# +# Copyright (c) 2017-present, Bahar Irfan # +# # +# mmltur script creates a smaller version of the dataset, using the 6th repeat second fold (used for the# +# evaluations). # +# # +# Please cite the following work if using this code: # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # +# # +# Each script in this project is under the GNU General Public License. # +#========================================================================================================# + import pandas import csv import os diff --git a/scripts/evm/evm_IMDB.py b/scripts/evm/evm_IMDB.py index ab7c263..15d7d46 100755 --- a/scripts/evm/evm_IMDB.py +++ b/scripts/evm/evm_IMDB.py @@ -9,9 +9,8 @@ # Recognition Dataset. # # # # Please cite the following work if using this code: # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # Ethan M. Rudd, Lalit P. Jain, Walter J. Scheirer and Terrance E. Boult (2018), "The Extreme Value # # Machine" in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 40, no. 3. # diff --git a/scripts/mmibn/RecognitionMemory.py b/scripts/mmibn/RecognitionMemory.py index 91039aa..c41b66e 100755 --- a/scripts/mmibn/RecognitionMemory.py +++ b/scripts/mmibn/RecognitionMemory.py @@ -15,9 +15,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # The pyAgrum library is used for implementing the Bayesian network structure: # # Gonzales, Christophe and Torti, Lionel and Wuillemin, Pierre-Henri (2017), 'aGrUM: a Graphical # diff --git a/scripts/mmibn/WeightOptimisation.py b/scripts/mmibn/WeightOptimisation.py index 961eb27..83d28a7 100755 --- a/scripts/mmibn/WeightOptimisation.py +++ b/scripts/mmibn/WeightOptimisation.py @@ -14,9 +14,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # * Bayesian optimisation is a variant of the code by Thomas Huijskens: # # https://github.com/thuijskens/bayesian-optimization # diff --git a/scripts/mmibn/crossValidation.py b/scripts/mmibn/crossValidation.py index cda2a12..5f32663 100755 --- a/scripts/mmibn/crossValidation.py +++ b/scripts/mmibn/crossValidation.py @@ -13,9 +13,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # crossValidation, RecognitionMemory and each script in this project is under the GNU General Public # # License. # diff --git a/scripts/mmibn/run_CrossValidationOnRobot.py b/scripts/mmibn/run_CrossValidationOnRobot.py index 4f82f71..ca730f4 100755 --- a/scripts/mmibn/run_CrossValidationOnRobot.py +++ b/scripts/mmibn/run_CrossValidationOnRobot.py @@ -14,9 +14,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # This script, RecognitionMemory and each script in this project is under the GNU General Public # # License. # diff --git a/scripts/mmibn/run_KFoldCrossValidation.py b/scripts/mmibn/run_KFoldCrossValidation.py index 26ce0e3..71dbf37 100755 --- a/scripts/mmibn/run_KFoldCrossValidation.py +++ b/scripts/mmibn/run_KFoldCrossValidation.py @@ -14,9 +14,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # This script, RecognitionMemory and each script in this project is under the GNU General Public # # License. # diff --git a/scripts/mmibn/run_TestOnRobotValidation.py b/scripts/mmibn/run_TestOnRobotValidation.py index b6cb887..92cf21b 100755 --- a/scripts/mmibn/run_TestOnRobotValidation.py +++ b/scripts/mmibn/run_TestOnRobotValidation.py @@ -17,9 +17,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # This script, RecognitionMemory and each script in this project is under the GNU General Public # # License. # diff --git a/scripts/other/pyagrum_structure_learning.py b/scripts/other/pyagrum_structure_learning.py index 84bf51f..e3ffdc2 100644 --- a/scripts/other/pyagrum_structure_learning.py +++ b/scripts/other/pyagrum_structure_learning.py @@ -1,3 +1,19 @@ +# coding: utf-8 + +#! /usr/bin/env python + +#========================================================================================================# +# Copyright (c) 2017-present, Bahar Irfan # +# # +# pyagrum_structure_learning applies structure learning on the Multi-modal Long-Term Recognition Dataset# +# # +# Please cite the following work if using this code: # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # +# # +# Each script in this project is under the GNU General Public License. # +#========================================================================================================# + import pyAgrum as gum import os import pandas as pd diff --git a/scripts/other/run_EvaluateSystem.py b/scripts/other/run_EvaluateSystem.py index e46e0af..5f10f84 100755 --- a/scripts/other/run_EvaluateSystem.py +++ b/scripts/other/run_EvaluateSystem.py @@ -13,9 +13,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # This script, RecognitionMemory and each script in this project is under the GNU General Public # # License. # @@ -55,7 +54,7 @@ def plotConfusionMatrix(results_folder, conf_matrix_file_set): num_people = 100 update_methods = ["none", "evidence"] - dest_main = "ColombiaExperiment/" + dest_main = "HRIExperiment/" normMethod = "hybrid" db_file = "db_data.csv" init_recog_file = "InitialRecognition_data.csv" @@ -71,6 +70,10 @@ def plotConfusionMatrix(results_folder, conf_matrix_file_set): optim_values = pandas.read_csv(dest_main + optim_file, dtype={"Evidence_method": object, "Norm_method": object, "Optim_params":object}, usecols = {"Evidence_method", "Norm_method", "Optim_params"}) + with open(dest_main + stats_file, 'w') as outcsv: + writer = csv.writer(outcsv) + writer.writerow(["Model","FAR","FR_FAR","DIR","FR_DIR","Loss","FR_Loss","Num_recog","Num_enrolled","Total_Time"]) + for updateMethod in update_methods: start_time = time.time() if updateMethod == "evidence": @@ -89,22 +92,21 @@ def plotConfusionMatrix(results_folder, conf_matrix_file_set): weights.insert(0, faceWeight) RB = RecognitionMemory.RecogniserBN() + start_time_run = time.time() num_recog, FER, stats_openSet, stats_FR, num_unknown = RB.runCrossValidation(num_people, results_folder, None, None, None, None, None, isTestData = False, isOpenSet = False, weights = weights, faceRecogThreshold = None, qualityThreshold = qualityThreshold, normMethod = normMethod, updateMethod = updateMethod, probThreshold = None, isMultRecognitions = False, num_mult_recognitions = 3, qualityCoefficient = None, db_file = db_file_model, init_recog_file = init_recog_file_model, final_recog_file = final_recog_file_model, valid_info_file = None, isSaveRecogFiles = isSaveRecogFiles, isSaveImageAn = isSaveImageAn) - + time_run = time.time()-start_time_run loss = cost_function_alpha*(1.0 - stats_openSet[0]) + (1.0-cost_function_alpha)*(stats_openSet[1]) F_Loss = cost_function_alpha*(1.0 - stats_FR[0]) + (1.0-cost_function_alpha)*(stats_FR[1]) with open(dest_main + stats_file, 'a') as outcsv: writer = csv.writer(outcsv) - writer.writerow([model_name, stats_openSet[1], stats_FR[1], stats_openSet[0], stats_FR[0], loss, F_Loss, num_recog, num_unknown]) + writer.writerow([model_name, stats_openSet[1], stats_FR[1], stats_openSet[0], stats_FR[0], loss, F_Loss, num_recog, num_unknown, time_run]) for matrix_f in ["Network", "FaceRecognition"]: conf_file = conf_matrix_file.replace(".csv", matrix_f + ".csv") plotConfusionMatrix(results_folder, conf_file) - - print "time for " + model_name + ":" + str(time.time() - start_time) diff --git a/scripts/other/run_KFoldCrossValidation.py b/scripts/other/run_KFoldCrossValidation.py index 97de6af..de6207a 100755 --- a/scripts/other/run_KFoldCrossValidation.py +++ b/scripts/other/run_KFoldCrossValidation.py @@ -14,9 +14,8 @@ # Identification in HRI', 2018 ACM/IEEE International Conference on Human-Robot Interaction Social # # Robots in the Wild workshop. # # # -# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Incremental # -# Bayesian Network with Online Learning for Open World User Identification', ACM Transactions on # -# Human-Robot Interaction (THRI). # +# B. Irfan, M. Garcia Ortiz, N. Lyubova, and T. Belpaeme (under review), 'Multi-modal Open World User # +# Identification', ACM Transactions on Human-Robot Interaction (THRI). # # # # This script, RecognitionMemory and each script in this project is under the GNU General Public # # License. #