photoprism/internal/entity/marker_fixtures.go

111 lines
36 KiB
Go
Raw Normal View History

package entity
type MarkerMap map[string]Marker
func (m MarkerMap) Get(name string) Marker {
if result, ok := m[name]; ok {
return result
}
return *UnknownMarker
}
func (m MarkerMap) Pointer(name string) *Marker {
if result, ok := m[name]; ok {
return &result
}
return UnknownMarker
}
var MarkerFixtures = MarkerMap{
"1000003-1": Marker{
ID: 1,
FileID: 1000003,
SubjectUID: "lt9k3pw1wowuy3c3",
MarkerSrc: SrcImage,
MarkerType: MarkerLabel,
X: 0.308333,
Y: 0.206944,
W: 0.355556,
H: .355556,
},
"1000003-2": Marker{
ID: 2,
FileID: 1000003,
SubjectUID: "",
MarkerName: "Unknown",
MarkerSrc: SrcImage,
MarkerType: MarkerLabel,
X: 0.208333,
Y: 0.106944,
W: 0.05,
H: 0.05,
},
"1000003-3": Marker{
ID: 3,
FileID: 1000003,
SubjectUID: "",
MarkerSrc: SrcImage,
MarkerType: MarkerLabel,
MarkerName: "Center",
X: 0.5,
Y: 0.5,
W: 0,
H: 0,
},
"1000003-4": Marker{
ID: 4,
FileID: 1000003,
SubjectUID: "",
MarkerSrc: SrcImage,
MarkerType: MarkerFace,
MarkerName: "Jens Mander",
LandmarksJSON: []byte("[{\"name\":\"lp46\",\"x\":-0.08359375,\"y\":-0.027083334,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp46_v\",\"x\":0.08671875,\"y\":-0.009375,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"lp44\",\"x\":-0.0546875,\"y\":-0.048958335,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp44_v\",\"x\":0.06328125,\"y\":-0.033333335,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"lp42\",\"x\":-0.021875,\"y\":-0.03125,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp42_v\",\"x\":0.03203125,\"y\":-0.025,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"lp38\",\"x\":-0.0265625,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp38_v\",\"x\":0.03125,\"y\":0.0052083335,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp312\",\"x\":-0.06796875,\"y\":-0.008333334,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"lp312_v\",\"x\":0.06953125,\"y\":0.008333334,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"mouth_lp93\",\"x\":-0.00703125,\"y\":0.09375,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"mouth_lp84\",\"x\":-0.04921875,\"y\":0.128125,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"mouth_lp82\",\"x\":-0.01328125,\"y\":0.16145833,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"mouth_lp81\",\"x\":-0.0078125,\"y\":0.13333334,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp84\",\"x\":0.034375,\"y\":0.14479166,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"eye_l\",\"x\":-0.0484375,\"y\":-0.004166667,\"h\":0.030208332,\"w\":0.02265625},{\"name\":\"eye_r\",\"x\":0.0484375,\"y\":0.0052083335,\"h\":0.030208332,\"w\":0.02265625}]"),
EmbeddingsJSON: []byte("[[0.013083286379677253,-0.0008417412393203858,-0.08209611917089321,-0.019111885734551474,0.021923530432215503,0.018732009048816976,0.035886940137015974,0.1130656608853727,-0.013879639663148906,-0.00007318769249725892,-0.10930376566056604,0.013017650306083043,0.03493398843961118,0.030367043595619828,-0.02661832006282799,0.02317542733842455,0.030808785430323865,-0.0110955273903513,-0.004947671380390304,-0.06481432146179103,-0.03562657031511941,0.01917426998954447,-0.03997564976901405,-0.043818762666068364,0.05985756953306272,-0.05656645149655018,0.006831462179655297,0.004125197643702118,0.08632503986770987,-0.04539499688491293,-0.007410491757254501,-0.02791636441556727,0.008375881368984935,-0.03352591464527212,-0.01024936807666946,-0.013452909148946745,-0.0455983581185236,0.005133020258791293,-0.05195581933944145,-0.07427988463687213,0.00630390028198304,-0.018452912748167127,-0.014417383661195559,-0.018022492860528778,0.05058799136684855,0.007851475361629147,-0.0033008657326001646,-0.037933898483223455,-0.03585054885081868,-0.01316437888895517,0.02913029629687692,-0.06876965414506842,0.027597906058259312,-0.08860803950803726,-0.1005048527606724,0.04859707253378557,-0.0691461480095216,-0.004108821124824582,0.024191758670076023,-0.004501372695590575,-0.003853594934054346,-0.017837990602979782,0.015521848826722015,0.0712632629325235,-0.1510830115846754,-0.00992026634344995,0.03799075369172833,0.09032564313020613,0.010611904884914678,-0.030697168365608873,-0.05355072821183228,-0.08723970013994914,0.03118943933108993,0.031918868148328394,0.0276473572229953,-0.028556344657796252,0.015007092266541835,0.027729347507862684,0.04544274754781616,-0.04999806778117011,0.0570203740294674,0.03835048879960994,-0.0027708371095958684,-0.002584607244562065,-0.058584824699194085,-0.00862370178357778,0.015049961132987713,-0.030933803486454046,0.012191597958574715,-0.0008941357107067466,-0.0348049752091627,0.027176252010889523,0.0461005164432102,-0.000611616832778758,0.009690149103200534,0.016906353393915857,-0.0540479915345624,-0.06223405395795713,-0.09107930214159932,-0.04772242706886826,0.06630155338614292,0.0371553603934971,0.061534576620184384,-0.008096183628180858,-0.03912759815393272,-0.0010451483965827953,-0.01986466956410297,-0.06292796414605956,-0.009854497586070874,-0.033622932201102754,-0.03317653787458191,0.009841683031503618,0.022866690743999052,0.010883092398172488,0.07389167704108482,-0.026557030305857217,0.018303901798465284,0.039156475488107266,0.027918357207828405,-0.0001480534094231541,0.0418863059041099,0.009360184503406473,0.0066549371575869865,-0.09114787981314919,-0.05277049334079438,-0.006547348450791211,0.05643273232859514,0.020804854646027934,0.020563210185937368,0.03710431957835912,0.007350085493263752,0.022986338887986204,-0.05778787991847159,-0.05102941878429307,0.025830275678329274,-0.03450106360057107,0.05655901476028061,-0.009602358944452714,0.04392567950170963,0.03000342953184249,-0.027931746077442407,0.017470708798638532,-0.0020853675052261425,-0.052778450846998406,0.03815768240914008,-0.015791185907723073,0.013690107091628736,-0.030241923396212355,0.02386683317712862,-0.040054973733698596,-0.0005362860328776602,-0.045667531139463646,0.004809388239980688,-0.04368660146511412,0.06624780772342401,-0.03508437913888463,-0.02735953041867514,-0.049531415215267154,0.015232385479245996,0.029788676575147145,-0.007270420735911989,-0.00483835298157672,0.06045303867951421,-0.07321751431425214,0.027037499621521587,-0.02314658845560742,0.012977987011931001,0.0338920730888843,-0.02934176132446363,0.04786481321065313,-0.0099853434624993,0.04710036333722752,0.03620079313865186,0.03142659728114243,0.020671303209698184,0.021940072146660362,0.023176980343224757,0.0273335047667591,0.017490618402760325,0.005401539498251791,0.013324607193214467,0.02206191691620473,-0.05340798466182817,-0.02666354815776871,0.035789468902129674,0.006111693256493996,-0.014217273598336879,-0.06654642278714365,0.03125937059989004,0.009036998859443555,0.030831652781777616,-0.006743640019971343,0.025713677112075055,0.0027379258292
X: 0.6,
Y: 0.7,
W: 0.2,
H: 0.05,
},
"1000003-5": Marker{
ID: 5,
FileID: 1000003,
FaceID: FaceFixtures.Get("unknown").ID,
SubjectUID: "",
SubjectSrc: SrcAuto,
MarkerSrc: SrcImage,
MarkerType: MarkerFace,
MarkerName: "Corn McCornface",
LandmarksJSON: []byte("[{\"name\":\"lp46\",\"x\":-0.10546875,\"y\":-0.045898438,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"lp46_v\",\"x\":0.11328125,\"y\":0.0126953125,\"h\":0.034179688,\"w\":0.045572918},{\"name\":\"lp44\",\"x\":-0.053385418,\"y\":-0.0546875,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"lp44_v\",\"x\":0.09375,\"y\":-0.0078125,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"lp42\",\"x\":-0.015625,\"y\":-0.030273438,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"lp42_v\",\"x\":0.0546875,\"y\":-0.0087890625,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"lp38\",\"x\":-0.033854168,\"y\":-0.0087890625,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"lp38_v\",\"x\":0.037760418,\"y\":0.01171875,\"h\":0.032226562,\"w\":0.04296875},{\"name\":\"lp312\",\"x\":-0.091145836,\"y\":-0.02734375,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"lp312_v\",\"x\":0.08984375,\"y\":0.021484375,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"mouth_lp93\",\"x\":-0.026041666,\"y\":0.07714844,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"mouth_lp84\",\"x\":-0.102864586,\"y\":0.08496094,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"mouth_lp82\",\"x\":-0.05859375,\"y\":0.12109375,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"mouth_lp81\",\"x\":-0.045572918,\"y\":0.10058594,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"lp84\",\"x\":-0.0065104165,\"y\":0.1171875,\"h\":0.033203125,\"w\":0.044270832},{\"name\":\"eye_l\",\"x\":-0.059895832,\"y\":-0.015625,\"h\":0.022460938,\"w\":0.029947916},{\"name\":\"eye_r\",\"x\":0.059895832,\"y\":0.015625,\"h\":0.022460938,\"w\":0.029947916}]"),
EmbeddingsJSON: []byte("[[-0.01391313475,-0.031814132,0.017377053075,-0.01851261325,0.021255451499999998,-0.051055306,0.0366150855,0.007998470175,0.0695672645,-0.1067636275,0.0307072165,0.02941578425,0.054768010500000006,0.041151049,-0.06493903375,0.0015896528499999996,-0.05437162425,0.011924136,-0.025054364,0.0009921848250000003,0.012807875,-0.01319641825,-0.00488935855,-0.07366566999999999,-0.0611034065,-0.06666547924999999,-0.04888238425,-0.035091203,-0.01854779615,-0.024557007999999998,0.0030882324,-0.055875238499999993,-0.0246700375,-0.02172630285,-0.025565405,0.058197003,0.0547107775,0.047857131,-0.04580487,-0.00021249714999999926,0.009770386499999999,0.044646309999999995,0.0018705221250000003,0.0371642205,0.018666550325,-0.0032051121500000002,0.0057689690000000005,0.06864431525,-0.04906746575,-0.07431345875,-0.0647896445,0.0120775261,-0.02890944,0.01879340475,0.024201165499999996,0.04355076025,-0.014099167999999999,0.026033113750000003,0.025052837749999998,-0.068487575,0.022659832499999998,-0.0027816580000000002,0.03500908899999999,0.012073708,0.006179701499999999,0.034802054,-0.01799351825,0.0457090165,0.0036213202500000002,-0.008580024424999999,-0.072938294,-0.016224131250000003,0.06459961750000001,-0.04963675325,0.08387918625,-0.13179572750000002,-0.011209804,0.011490459325,-0.04273579375,-0.0603162555,-0.03941750125,0.061718414,0.029566903,0.011713920749999999,-0.07820421,0.042141458,0.04053815075,-0.0431640475,-0.009912542250000001,0.0083520422,0.04968228825,0.061740414,-0.003251780325,-0.0009849047250000001,-0.07888640699999999,0.00013775579999999977,0.0545293975,0.0314430285,-0.025010752249999997,-0.0754261725,0.00026732155,-0.04167998875,-0.038423044,-0.012128476325,-0.042172063999999995,-0.03992470075,0.055492729500000004,0.005174035799999999,-0.0491557875,0.047224008,0.027870127375,0.11123915125,-0.0017566490000000008,0.06637293625,0.08444959,-0.038633152000000004,0.040549324,0.0181765085,-0.0103707255,-0.052444608749999996,-0.0721162075,0.0017395296250000006,0.03576854825,-0.0010544938500000002,-0.03536455575,0.026296009000000002,-0.011038092,0.009561795625000001,0.0061376165,0.016413343999999996,-0.0007041408250000004,0.008430746000000001,0.007772767000000001,0.035255850500000005,0.03609753,-0.004700959499999999,-0.0244996355,0.029143511,0.0019076424499999993,-0.02425797625,-0.02824462725,0.03748850525,0.004536174249999999,0.094921252,0.0402888305,-0.035919796500000004,0.0325914395,0.028936399249999998,0.0100435923175,0.051378176750000004,0.0466342265,-0.104555035,-0.058734387250000006,-0.053190730000000006,-0.004201957500000001,-0.0030598753299999996,-0.009583216875000002,-0.05078611825,-0.037133980925000004,0.0406709395,0.01118452775,-0.028617762,-0.006732865225,-0.03122189575,-0.054440001749999994,0.055957135,-0.054629830500000004,0.00548484575,0.0018623927500000005,-0.0054835023,0.04359883825,-0.04169836625,0.025491153,0.035283773500000004,0.020951236874999998,0.017083047,0.011288541499999999,0.029325848999999998,0.031001949125000004,0.04632318125,0.058114136999999996,-0.018353527600000002,0.0010329377499999999,-0.05167622725,0.0015087445249999999,0.0665028595,-0.017552406,0.0030785925075000006,0.067237884,-0.045436311,0.022067097,-0.068492519,-0.09581154575,0.02946200275,0.019267693750000002,-0.013623341,-0.0023418241499999996,0.057798097500000006,-0.02830513875,0.00967313775,-0.0156008155,-0.038696254,-0.046455728749999994,-0.020938623415,0.00489014375,0.0191956194,0.01110382618,0.020775547499999998,0.116135215,-0.040037983750000006,0.039333228250000005,0.011678268775,0.0650113585,0.0023590035,-0.05381264350000001,-0.008376887255000002,-0.05688126,0.01151456675,0.00003846570000000035,-0.01287236325,-0.06661450099999999,-0.03827642075,-0.045446761,-0.03154112575,0.028140978,0.070225409,-0.020004859,0.0193362475,-0.0034820117499999997,-0.074293175,-0.04876132,0.0074359382499999994,0.0066796961250000005,-0.011634815875,0.009048144557499999,0.0344562235,-0.01762691475,0.019571052749999998,0.026697968750000002,0.015484052000000002,0.03876590725,0.0037216567,0.04729691375,0.008930467375,-0.078001988
X: 0.2,
Y: 0.3,
W: 0.1,
H: 0.1,
},
"1000003-6": Marker{
ID: 6,
FileID: 1000003,
FaceID: FaceFixtures.Get("john-doe").ID,
SubjectSrc: SrcAuto,
SubjectUID: "",
MarkerSrc: SrcImage,
MarkerType: MarkerFace,
MarkerName: "",
LandmarksJSON: []byte("[{\"name\":\"lp46\",\"x\":-0.08359375,\"y\":-0.027083334,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp46_v\",\"x\":0.08671875,\"y\":-0.009375,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"lp44\",\"x\":-0.0546875,\"y\":-0.048958335,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp44_v\",\"x\":0.06328125,\"y\":-0.033333335,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"lp42\",\"x\":-0.021875,\"y\":-0.03125,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp42_v\",\"x\":0.03203125,\"y\":-0.025,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"lp38\",\"x\":-0.0265625,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp38_v\",\"x\":0.03125,\"y\":0.0052083335,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp312\",\"x\":-0.06796875,\"y\":-0.008333334,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"lp312_v\",\"x\":0.06953125,\"y\":0.008333334,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"mouth_lp93\",\"x\":-0.00703125,\"y\":0.09375,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"mouth_lp84\",\"x\":-0.04921875,\"y\":0.128125,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"mouth_lp82\",\"x\":-0.01328125,\"y\":0.16145833,\"h\":0.045833334,\"w\":0.034375},{\"name\":\"mouth_lp81\",\"x\":-0.0078125,\"y\":0.13333334,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"lp84\",\"x\":0.034375,\"y\":0.14479166,\"h\":0.044791665,\"w\":0.03359375},{\"name\":\"eye_l\",\"x\":-0.0484375,\"y\":-0.004166667,\"h\":0.030208332,\"w\":0.02265625},{\"name\":\"eye_r\",\"x\":0.0484375,\"y\":0.0052083335,\"h\":0.030208332,\"w\":0.02265625}]"),
EmbeddingsJSON: []byte("[[-0.015105677000169373,-0.0005582744874266051,0.0480268501406662,-0.03601115760977173,0.0005837739331054689,0.014168089953522492,-0.03945336629091645,-0.02582770810183487,0.020898761370506287,0.049166841007919314,0.021960500727076723,-0.019064476425213243,0.02198730232398834,0.0006670523258575441,0.03028046368291855,0.00649638007861023,-0.01584042613295212,0.00530397326763153,-0.06404373233350608,0.03889477750802231,-0.0365899261901268,0.0360787547656456,0.07579429823342132,0.039115246617597965,-0.0777424514863777,0.035950400633987425,-0.01904672616637268,0.031240118709612276,-0.01142303718094612,0.021169409966093445,-0.04066713893357315,0.048964979162612915,-0.016256413336937715,-0.02378354035888214,-0.020449917192553707,-0.02040227800516968,0.06541690078029251,0.016761249534914705,0.03380005035063598,-0.10038679582336427,0.043679719882033535,0.03128701222455444,0.012390233834701538,0.05524386205410767,0.021537026348385238,-0.016655772903281404,0.007295974349593354,-0.000005785312992858532,-0.047790829845092773,0.017440576051146697,-0.06534523391118621,0.06609203363401413,0.03238222320728302,0.006614993631034087,-0.054927458582173155,0.030833110256991578,-0.0056855157837505345,-0.007370784518985901,0.0013351148462055202,0.047366844577483365,0.04135019693103943,-0.02510304556774292,-0.05305447016115189,-0.03180977055114746,0.012452435193779296,-0.031038226814250947,-0.06159064720963287,0.057565623878417974,0.006987256155133055,0.10980759767712402,0.0014624758511650082,0.04941792959784012,0.02249399537556839,-0.007318808567618561,0.011643714617645264,-0.033996864613095854,-0.10756568994960479,-0.008790611639031982,-0.06265860528228379,-0.03834362793397904,-0.007061803256170654,-0.02360514984864273,-0.030340688408576965,-0.006711280069554138,-0.026063804222563172,-0.06257436487065124,-0.03489222804085922,0.023775160926244356,-0.05953325934691238,-0.0015599671627334586,0.04257923482005539,-0.02072714042014847,0.042186514202873227,0.03334131403590164,-0.04231802868860626,-0.03938228046069336,0.04991599600813751,0.005012853217630309,0.02852926982268677,-0.04592934168044281,-0.0446876756071167,0.05780069138760376,-0.06523845092017364,0.03691154157677917,0.0048527119732078555,-0.008498008999919891,-0.06625776342607116,0.013960302090915604,-0.029253019821994783,0.02477269871644745,0.010155390116101837,0.03100301871340158,-0.07413353268207168,0.01750142506529999,0.03461705135130691,0.04982243958808899,0.00851692480498886,-0.002991416728403473,0.01759018484255066,-0.07281463888115311,0.07669263036101531,0.0287119138326683,-0.0011225693401481635,-0.022214332482351686,0.08318748801869094,0.06656315672954559,0.0034995880579914086,0.04958693578422928,-0.027691547638692474,-0.03405751975708465,-0.062014044191894525,-0.0004367024225837711,0.007944679561768342,0.03339219333856888,-0.04039564807562256,-0.06730881179145813,-0.07099339792601776,-0.033052287483390806,-0.050682249608245855,0.011561693050074387,-0.09867453691846315,-0.02774825273226944,0.010811723733195496,0.02427582366474533,-0.02078586645137596,0.01433492286357048,0.026900254564299775,-0.05306856266233825,-0.007102414552368164,-0.02275204349867813,-0.03211197205357055,-0.014967170406674196,0.022953155306690905,-0.03644228327174301,0.012341418549354555,0.020687427985451052,-0.09076456366364288,0.031082595049208066,0.04102866745965958,-0.02306090883122635,0.027812227150472258,-0.013119295590370941,-0.004158771480469893,-0.007025444076653517,0.009275999232177735,-0.039368103392872236,0.01910143328294525,-0.05630273885418091,0.055353015055413055,-0.0014070097039474495,0.042947509516956334,0.0024906970417621615,-0.03561797166536834,0.006505803784743882,0.006665486497595978,-0.006378142944042969,0.05448368035679932,0.07332471840206146,-0.0014946864171386718,-0.008414893981474686,-0.00006825545633163364,0.02668107540572357,-0.024539537215417483,-0.07293688736830901,0.06344162595002364,-0.033607367797969814,-0.01986442914540863,0.026089177944317626,-0.022147074482840423,-0.08048881567908478,0.050637503425783534,-0.06346700348937226,-0.015700777833213043,-
X: 0.494531,
Y: 0.282292,
W: 0.285937,
H: 0.38125,
},
}
// CreateMarkerFixtures inserts known entities into the database for testing.
func CreateMarkerFixtures() {
for _, entity := range MarkerFixtures {
Db().Create(&entity)
}
}