46 lines
22 KiB
Go
46 lines
22 KiB
Go
|
package entity
|
||
|
|
||
|
type FaceMap map[string]Face
|
||
|
|
||
|
func (m FaceMap) Get(name string) Face {
|
||
|
if result, ok := m[name]; ok {
|
||
|
return result
|
||
|
}
|
||
|
|
||
|
return UnknownFace
|
||
|
}
|
||
|
|
||
|
func (m FaceMap) Pointer(name string) *Face {
|
||
|
if result, ok := m[name]; ok {
|
||
|
return &result
|
||
|
}
|
||
|
|
||
|
return &UnknownFace
|
||
|
}
|
||
|
|
||
|
var FaceFixtures = FaceMap{
|
||
|
"known": Face{
|
||
|
ID: "PN6QO5INYTUSAATOFL43LL2ABAV5ACZK",
|
||
|
Embedding: "[-0.0036004473650348523,0.0025974890421894504,-0.07213138572887015,-0.013966886307785017,0.029814516754777698,0.018431306065333514,0.04328678683275605,0.10726412649455114,-0.00857895849589533,0.00015031830995419337,-0.11193530266575982,0.00598015213337374,0.031203009035183738,0.03274536227383253,-0.03452776390372318,0.028153505458811914,0.02511448587697563,-0.017625339120966463,-0.005405653335459789,-0.06744733770486135,-0.03306791284650082,0.013698945211835291,-0.0503100641080214,-0.04418265454625754,0.060907711645144816,-0.05617526303948893,0.012771532956195571,0.0037938154085387366,0.08883200678429733,-0.05672764414041005,-0.019006595766328523,-0.024769387680569792,0.012939827451873094,-0.03731050916493861,-0.0068407323938147364,-0.011923546390846682,-0.04378642741443105,0.0029307896098720847,-0.05943630386283123,-0.07916683143242365,0.006690760891798869,-0.013869383519771895,-0.016588667345244723,-0.026077404683579355,0.043508655458277104,0.005469399019900467,0.007684818349324758,-0.028470117873820554,-0.025584215745239447,-0.008796346777722924,0.034374588240420625,-0.05722439097529167,0.02595474286989837,-0.09741574250159424,-0.08874101509994643,0.05448400872561275,-0.0695875416226843,0.00089110309039573,0.025058680116099474,-0.006178110611635321,-0.002518553172310205,-0.029515356724812477,0.0238739332258743,0.06658096272999098,-0.1564555358130475,-0.008709017743519457,0.03209072962681542,0.09870203860711181,0.00829712868100142,-0.03850979283180725,-0.06111498917240463,-0.08450715169436442,0.031164670737776894,0.03517417140466631,0.032740310109355596,-0.02086616181318348,0.02103227980919008,0.030216389475166916,0.04215177653544982,-0.046834672739073296,0.051736667788971555,0.032218563127081344,0.002121754496458415,0.002041610618766947,-0.0566707892715052,-0.004935965613620098,0.02968795934888889,-0.03607260567138157,0.01706607347148768,0.008911252568159344,-0.04437085494035743,0.02887741866023545,0.047028680184721824,0.009376628669207876,0.006072752256530187,0.0219422175503246,-0.053903890459197995,-0.06489891929151383,-0.08391869094066642,-0.05179203606979039,0.07285809277873542,0.02558113279915027,0.06051344190553358,-0.014303868784339865,-0.04292498556227785,-0.005026351165140286,-0.01816321197838741,-0.06294424876160998,-0.004826497104051721,-0.039041059715555985,-0.0301644693828563,0.01106692459938265,0.022480294059897207,0.01464751390616157,0.06461364014912052,-0.02236762078330746,0.023189011715808082,0.03885305028107245,0.033080528702818246,0.00001285121753878129,0.046981317813570095,-0.0016702159097000565,0.010395301706694927,-0.08295656919116964,-0.04776992379782047,-0.010529325155296775,0.06896708110539723,0.02111988148270817,0.01724771201255671,0.03968232354435814,0.01313348610882861,0.02795228553354465,-0.055715937249157146,-0.05810640994048216,0.0273865702239438,-0.03675697001529427,0.060719245735121316,-0.0029605221957433887,0.03700371422975787,0.033265011460953356,-0.022711288283865302,0.018561041079731003,-0.0009519883658811396,-0.0557399686727075,0.042858141552412105,-0.010269456726116837,0.01543971107085874,-0.026913187896864803,0.018680346484106845,-0.041249091559245776,0.004018278052457904,-0.04467486527495029,0.0038033853908202957,-0.05159326913940392,0.05314557955282533,-0.030726907521850255,-0.016873368996188465,-0.040995730193690155,0.014146163901674362,0.037674964619028306,-0.0019396781055547939,-0.009656225949734084,0.05842872642415417,-0.07984459472221411,0.018104734634538072,-0.02594236794143055,0.018071964682251675,0.03189645129467926,-0.03132505070456775,0.04753412842028051,0.0028851178568010177,0.04919917741172658,0.04425330037715131,0.013048802303167068,0.017553924188213037,0.017184774244905755,0.017694107605014164,0.01900943230721036,0.013006298425476818,0.007991981428663135,0.020653843554381622,0.028604389142831158,-0.0558899433906232,-0.020575997776454975,0.032021313901190056,0.014680564139766645,-0.023215720423765886,-0.06956375406837889,0.019167613789316224,0.012806918063201653,0.023051841888119755,0.006344150170007088,0.016793924449806326,-0.0015901029991245933,0.
|
||
|
PersonUID: "rqu0xs11qekk9jx8",
|
||
|
CreatedAt: Timestamp(),
|
||
|
UpdatedAt: Timestamp(),
|
||
|
DeletedAt: nil,
|
||
|
},
|
||
|
"unknown": Face{
|
||
|
ID: "IW2P73ISBCUFPIAWSIOZKRDCHHFHC35S",
|
||
|
Embedding: "[-0.022496677579582215,0.035567367743692783,0.07768714714541473,-0.024945000860870363,0.030828805857681274,-0.01693104979570816,-0.04875652166086578,-0.021799255903726958,0.03922625390071869,0.038597711802490234,0.029680879044233704,-0.0014995683515270242,0.02370395886912384,0.012298511635467529,-0.011153248595230866,-0.004703174076201783,-0.0058441524345619195,0.0121467273272995,-0.011750088146634752,0.007663392247307586,0.0033583090668476865,0.04736641875738144,0.0720052817664261,-0.010235987882936094,-0.060413632866550444,0.03797902367163086,0.029624240715176393,-0.007726394502581023,0.023027080619498826,-0.004110434488621521,-0.04839350704872207,0.017993521105184936,0.0017007888007423404,-0.028835229342066955,0.009028906026785279,0.0024176102542343147,0.02169313806382828,0.01257592942271042,0.003211545438947373,-0.03264268670733643,-0.024622041092111968,0.006587380071188352,0.03442832000200806,0.058389811234378045,-0.04366462490420113,-0.0021702135339711,0.0011912204749256281,0.04230056141517792,-0.05162670325854492,0.020825025449315644,-0.033760298540503844,0.049420791136763766,0.016374290663905333,-0.00494668725274887,0.0207835526445401,0.02019750676385498,0.05112708409527931,-0.005386489172502136,-0.021796540441215137,0.020010080689944917,0.021335065354180907,-0.045023495205117794,-0.020347282762886505,-0.020541580573170473,0.010568246072303467,-0.05393726609652328,-0.10147803167987823,0.052183769407614135,-0.002381978284823609,0.03976606263284302,0.024586818564183804,0.03297582942961502,0.030000030976856232,-0.05005467654070511,0.02762888505870056,-0.03562164067453384,-0.05890901402814179,-0.0005290178944732668,-0.059088693759897615,-0.038578507775110626,-0.036801137763594054,-0.06683414654011308,-0.002152089905087586,-0.03382589345244205,-0.05526335011302948,-0.03284626237114868,-0.03597692033147812,0.002804868425481415,-0.016954549922741546,0.021594264673625185,0.0085838293324852,-0.006060113906183623,0.004600930358525084,0.020020871859327546,-0.05014669611194611,-0.044564205792665096,0.0135703529227417,0.02281465818463898,0.004023515147372436,-0.028594471913179015,-0.009483616916906738,0.026035977458236693,-0.03603783482624054,0.031628168594198605,0.0062018801403614775,-0.0183695618240654,-0.03235861031417847,-0.0024822087288140122,0.004788866998783112,0.021977990230247494,-0.007491315413535612,0.021506047256435394,-0.029249453418460847,0.0373397523212204,0.01085345583951065,0.03794099645187378,0.004716101070934295,0.03700470844623947,0.021622683058604736,-0.06902576927136002,0.07506316177490997,-0.004850261171823883,-0.014799526152019502,-0.02008093931021729,0.04140293938249588,0.02669623265576935,0.0004361748523136139,0.044338197089296906,0.005969945101598661,0.016253966374864197,-0.03789573098792724,0.019522963534627534,0.005512493915485382,0.021260389884998322,-0.024131564161605834,-0.0004240035348815922,-0.07936755698294831,-0.0024502311294784546,-0.041033922565155034,-0.000060871354707718595,-0.05117737712670288,-0.012333926330509186,-0.00332147351407318,-0.027831669102733617,-0.026231161609502795,0.04183922611410637,0.07129664018656845,-0.04533216452241516,0.0029880654502528374,0.007813772060280607,0.021728266176545715,0.006760357625381469,0.0009104323310457595,-0.008829625505519868,0.003427816720289611,0.030458969364133302,-0.07722279351830291,0.03331324758593139,0.029070102618891147,-0.02204155251153946,0.003238302410951996,-0.021406765139665985,-0.03671740642847633,0.02114884221661186,0.0040460562141693135,-0.040385980128547286,0.04725066640673431,-0.0374128344408136,-0.022368990202178196,-0.009008882119773864,0.05392042330630875,-0.04563896874513481,-0.00766877351221466,0.00971878639161949,0.007459929235227204,-0.044855803669644166,0.0013741937022499094,0.023200710085639953,-0.015990735422795103,0.010374560735560229,0.018510297555042268,0.028602813306422423,-0.03061955150315094,-0.07005298911458588,0.03077560074464035,-0.002753337030379487,-0.004010242710720825,0.022612441529040527,-0.04629517134167099,-0.041590199345787046,0.026599560761388398,0.03707417881679291,-0.02137844545651626
|
||
|
PersonUID: "",
|
||
|
CreatedAt: Timestamp(),
|
||
|
UpdatedAt: Timestamp(),
|
||
|
DeletedAt: nil,
|
||
|
},
|
||
|
}
|
||
|
|
||
|
// CreateFaceFixtures inserts known entities into the database for testing.
|
||
|
func CreateFaceFixtures() {
|
||
|
for _, entity := range FaceFixtures {
|
||
|
Db().Create(&entity)
|
||
|
}
|
||
|
}
|