Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Image ML Processor #91

Closed
DiegoPino opened this issue May 6, 2024 · 1 comment
Closed

Add Image ML Processor #91

DiegoPino opened this issue May 6, 2024 · 1 comment
Assignees
Labels
Future Unknown but hopeful about what comes Post processor Plugins The ones with a ->run() method
Milestone

Comments

@DiegoPino
Copy link
Member

DiegoPino commented May 6, 2024

What?

To use the WIP/experimental image/yolo endpoint in the NLP Container (might have to eventually rename the container though) we need a processor that sends to the endpoint a IIIF URL and a list of labels.

The return is a mixed set of data

See

curl -X GET -G -d "iiif_image_url=http%3A%2F%2Flocalhost%3A8183%2Fiiif%2F2%2F19a%252Fimage-obj-datastream-9d5c305c-aa8b-4d96-9362-7a235d94d2fd.jp2%2Ffull%2Ffull%2F0%2Fdefault.jpg" -d "labels[]=face" "http://127.0.0.1:6401/image/yolo"
{
{
	"message": "done",
	"web64": {
		"app": "nlpserver",
		"documentation": "https://github.com/esmero/nlpserver-fasttext/README.md",
		"endpoints": [
			"/status",
			"/gensim/summarize",
			"/polyglot/neighbours",
			"/langid",
			"/polyglot/entities",
			"/polyglot/sentiment",
			"/newspaper",
			"/readability",
			"/spacy/entities",
			"/afinn",
			"/fasttext",
			"/image/yolo"
		],
		"github": "https://github.com/esmero/nlpserver-fasttext",
		"last_modified": "2024-05-05",
		"version": "1.1.0"
	},
	"yolo": {
		"modelinfo": {
			"date": "2022-12-31T19:05:08.315811",
			"train_args": {
				"agnostic_nms": false,
				"augment": false,
				"batch": 16,
				"box": 7.5,
				"cache": "disk",
				"cfg": null,
				"close_mosaic": 10,
				"cls": 0.5,
				"conf": 0.001,
				"copy_paste": 0.1,
				"cos_lr": false,
				"data": "coco.yaml",
				"degrees": 0.0,
				"deterministic": true,
				"device": 2,
				"dfl": 1.5,
				"dnn": false,
				"dropout": false,
				"dynamic": false,
				"epochs": 500,
				"exist_ok": false,
				"fl_gamma": 0.0,
				"fliplr": 0.5,
				"flipud": 0.0,
				"format": "torchscript",
				"half": true,
				"hide_conf": false,
				"hide_labels": false,
				"hsv_h": 0.015,
				"hsv_s": 0.7,
				"hsv_v": 0.4,
				"image_weights": false,
				"imgsz": 640,
				"int8": false,
				"iou": 0.7,
				"keras": false,
				"label_smoothing": 0.0,
				"line_thickness": 3,
				"lr0": 0.01,
				"lrf": 0.01,
				"mask_ratio": 4,
				"max_det": 300,
				"mixup": 0.1,
				"mode": "train",
				"model": "yolov8m.yaml",
				"momentum": 0.937,
				"mosaic": 1.0,
				"name": "yolov8m",
				"nbs": 64,
				"nms": false,
				"opset": 17,
				"optimize": false,
				"optimizer": "SGD",
				"overlap_mask": true,
				"patience": 50,
				"perspective": 0.0,
				"plots": false,
				"pretrained": false,
				"project": "YOLOv8",
				"rect": false,
				"resume": false,
				"retina_masks": false,
				"save": true,
				"save_conf": false,
				"save_crop": false,
				"save_hybrid": false,
				"save_json": false,
				"save_txt": false,
				"scale": 0.9,
				"seed": 0,
				"shear": 0.0,
				"show": false,
				"simplify": false,
				"single_cls": false,
				"source": "ultralytics/assets/",
				"task": "detect",
				"translate": 0.1,
				"v5loader": true,
				"val": true,
				"verbose": false,
				"vid_stride": 1,
				"visualize": false,
				"warmup_bias_lr": 0.1,
				"warmup_epochs": 3.0,
				"warmup_momentum": 0.8,
				"weight_decay": 0.001,
				"workers": 8,
				"workspace": 4
			},
			"version": "8.0.0.dev0"
		},
		"objects": [
			{
				"box": {
					"x1": 0.08102,
					"x2": 0.27371,
					"y1": 0.05445,
					"y2": 0.81534
				},
				"class": 0,
				"confidence": 0.87145,
				"name": "person"
			},
			{
				"box": {
					"x1": 0.26051,
					"x2": 0.42469,
					"y1": 0.05833,
					"y2": 0.49728
				},
				"class": 0,
				"confidence": 0.86171,
				"name": "person"
			},
			{
				"box": {
					"x1": 0.64592,
					"x2": 0.81528,
					"y1": 0.06939,
					"y2": 0.92534
				},
				"class": 0,
				"confidence": 0.84706,
				"name": "person"
			},
			{
				"box": {
					"x1": 0.40324,
					"x2": 0.61078,
					"y1": 0.37495,
					"y2": 0.95515
				},
				"class": 0,
				"confidence": 0.84531,
				"name": "person"
			},
			{
				"box": {
					"x1": 0.40284,
					"x2": 0.55062,
					"y1": 0.09805,
					"y2": 0.51179
				},
				"class": 0,
				"confidence": 0.83104,
				"name": "person"
			},
			{
				"box": {
					"x1": 0.20215,
					"x2": 0.43625,
					"y1": 0.37195,
					"y2": 0.94029
				},
				"class": 0,
				"confidence": 0.8084,
				"name": "person"
			},
			{
				"box": {
					"x1": 0.52932,
					"x2": 0.67819,
					"y1": 0.10424,
					"y2": 0.91567
				},
				"class": 0,
				"confidence": 0.76334,
				"name": "person"
			},
			{
				"box": {
					"x1": 0.46965,
					"x2": 0.50386,
					"y1": 0.54762,
					"y2": 0.61522
				},
				"class": 27,
				"confidence": 0.31658,
				"name": "tie"
			}
		],
		"vector": [
			-0.0015085760449620423,
			0.0011027077821199255,
			0.0009335851354018257,
			0.0015694611687637476,
			-0.002122072212026941,
			-7.865099346437461e-05,
			0.0021429690900427946,
			0.0010464493225123854,
			0.001272148708643146,
			-0.002675969572340373,
			0.002451748343142389,
			-0.001001759349875626,
			0.00177484956624965,
			0.0028937691146594833,
			-0.0007459152367967865,
			0.0011318155956488427,
			0.007213988421863176,
			-0.002286822606286994,
			0.0021087577228819775,
			0.0009078487192680939,
			0.000889081169678203,
			-0.0012457417367037727,
			0.00028891257175025906,
			0.0009287730534833523,
			0.001069230544239338,
			-0.0020701929573056234,
			0.0014990791459120374,
			-3.8096714891653204e-06,
			-0.0019357909725716393,
			-0.0018058036618913494,
			-0.0018940022835638572,
			4.5143968406079534e-05,
			-0.0028535826657517457,
			-0.000297247796646681,
			0.0008713156535288307,
			0.006692599201645322,
			-0.0023336857429985514,
			-0.0009022821221359273,
			-0.0006933047987393815,
			-3.49571292379778e-05,
			0.004632728596938341,
			-0.002693251187704952,
			0.00011910888903023203,
			0.002983100275098008,
			0.0018439812125696563,
			-0.002365931811903242,
			0.0005947069353261215,
			0.0009056953519379314,
			-0.0017752634124827424,
			-0.0009422589965773905,
			0.0006492310586982818,
			-0.0028138555484546563,
			-0.0006505292773628544,
			0.003836978649573787,
			0.00041435272926878115,
			9.30828497630229e-05,
			0.0037258687132810083,
			0.0014423911676485685,
			0.0011686545093089462,
			0.0009051786333353943,
			0.0004064149416965797,
			-7.16506421425143e-05,
			0.0019050912886660579,
			0.0013775280765528047,
			0.0022740037427845094,
			-0.002668801972404701,
			-0.0009841745968588173,
			-0.0017239468330925798,
			-0.0015462772953914428,
			-0.0027885850039275676,
			-0.0021844347857348286,
			-0.0017552788344488372,
			0.0013846399392253065,
			0.003184138809301344,
			0.0027546168539151284,
			0.005200671276219526,
			-0.00021271090989429038,
			-0.00160866037287056,
			0.004199622959422055,
			-0.0005294382466408634,
			0.0012248283614007232,
			-0.001860748112573715,
			-0.0032653987898169094,
			0.0001969882734400284,
			0.0025355477275085074,
			0.0008596153650171291,
			0.005533586531838176,
			-0.001240037799655698,
			-0.001034513417388193,
			0.0006751477076946317,
			-0.0012479236207732316,
			-0.0011238878242867247,
			-0.0026050522125191473,
			0.004590269293206034,
			0.0018191472569644377,
			-0.0004325264354384929,
			-0.002073630520606242,
			9.849870293343457e-05,
			0.0020660924387352507,
			0.004267801533893186,
			-0.0004153595351388101,
			-0.0008164106784979703,
			-0.0005172032692673575,
			-0.0005545501226164544,
			-0.002288917761760907,
			0.00018659287615638157,
			-0.0019745958915144634,
			-0.001024977749713277,
			-0.00028684846652760434,
			0.0012325939879972562,
			-0.0015385393606698462,
			-0.0018904348630454518,
			-0.002023168382855075,
			0.002360971784669949,
			8.566084545609342e-05,
			-0.0024042957819268656,
			0.0020438769561213605,
			0.001336820902558497,
			-0.0006734347000948411,
			0.0012533551169070381,
			0.00045114730646954505,
			-0.0017800047328229208,
			0.003298277647523339,
			0.0017039299675108762,
			-0.00021176596885124708,
			-0.001091937174660611,
			0.0009672985790837327,
			0.002769741566816574,
			-0.0017867938378552063,
			-0.002784860387829736,
			-0.0007733217675835988,
			0.0010147806586595606,
			-0.0035395641419481007,
			0.002182119980665675,
			-0.0010034489077600448,
			0.0016684463059939377,
			-0.0036025983909204035,
			0.0011755851374978218,
			0.0014826152068035598,
			0.003046103650575701,
			0.002770103800108296,
			0.0032212527563065608,
			0.0007338959614533705,
			0.0018923620997032611,
			0.0029750738735260097,
			0.0006053729028495062,
			0.0012030411012273396,
			0.0009875832899068424,
			0.002635638182980841,
			-0.003456245299990453,
			0.0018366515857061651,
			-0.0015010697792877863,
			-0.0009943962570866795,
			0.0022135449560190595,
			-0.003772935473651673,
			-0.0002924121766345117,
			0.0012205467261844896,
			-0.0025982560372209205,
			0.001633862217980253,
			-0.0019372984711080719,
			-0.002431103166594043,
			0.0004026940374883671,
			0.004797619925166155,
			0.0043791195716801675,
			-0.0030962952328168506,
			2.5995802833019893e-05,
			-2.222365576766927e-05,
			-0.0020319958455582124,
			0.00414722427582959,
			-0.0006091560843168843,
			-0.00024343573743312527,
			0.004384765886060822,
			0.0028130511878660773,
			0.0014307573985555971,
			-0.0006851960874880513,
			0.00428539282690599,
			-0.0005760410208091356,
			-0.002472820092402522,
			0.005572838762939548,
			0.001578588292905027,
			0.00046421442468489046,
			0.00037209180541500873,
			0.0031071502121163973,
			-0.0006235384782133855,
			0.0010271611656736898,
			0.0048059345579130235,
			0.0015027780733769495,
			-0.0021610904173256585,
			0.00023105564285117597,
			-0.0007224222160462021,
			0.0004624687760240046,
			0.0013291605050867225,
			0.0041276688629383156,
			0.0009106849564504121,
			4.711152030947453e-05,
			-0.000281645899713086,
			-0.0023901165992572916,
			0.0009249523406876028,
			0.0024731457959868805,
			0.0009652644635724453,
			-0.0026582651550725095,
			0.0037818131352429928,
			-9.825888098568065e-05,
			0.0002675940996682194,
			-0.0013797684081540442,
			0.0046406718050477636,
			0.0018111312251158202,
			0.0016475180831324117,
			0.0014923377651748552,
			-0.0012878410460619057,
			0.001008103735180209,
			0.00017858544646465917,
			-0.0007120960926390585,
			-0.0023055538618450533,
			0.0001144756627454903,
			0.0012901784759820711,
			-0.0009656901525009892,
			-0.002023981699113846,
			-0.0005381257180783649,
			0.0016056839087470744,
			0.0018788791025533653,
			0.0007357932673186954,
			-0.00046845587722302496,
			-0.000954644983047624,
			0.0007198862294908541,
			0.001367131957512843,
			-0.0018780510565738833,
			-0.0005428481843760333,
			0.0007208494943064618,
			-0.0019067264055027293,
			0.00014115127533118814,
			0.0021922573279721884,
			0.002403378061407696,
			0.0018661386011650624,
			-0.0006977207100896156,
			-0.0002506597521991197,
			0.0036337730788594687,
			-0.0028074911307299066,
			0.0016479649239398964,
			0.002020292198670189,
			0.0015730357773858599,
			0.001420517296717405,
			0.0011470467160527038,
			0.003031347534205324,
			-0.0005349821600031352,
			-0.0016446667627160855,
			0.004003457959531998,
			-0.0009729303405003241,
			-0.0016265824364916474,
			4.6629722192312724e-05,
			0.0019878224736862246,
			0.0034634640415164334,
			0.001536361483084421,
			0.0016434137937535367,
			-0.000277174663531862,
			0.0011783144958266618,
			0.0009019805752935345,
			-0.0017807049248266323,
			0.00042730798998504824,
			0.002815758864046031,
			0.0013817717680084873,
			0.002529712401351692,
			-0.0018202774389751409,
			-0.002237530361873567,
			-0.0005453627833769091,
			-0.00286335471598463,
			0.0028650122219967817,
			-0.0007730593428794141,
			-0.0008230855398164223,
			-0.00112970512126539,
			0.0023770981185797335,
			0.0038966196422453698,
			0.0069431915801019106,
			-0.0018067257424078495,
			0.0018502151838877907,
			0.0016649195395046943,
			0.0018311272334129971,
			0.0008570295920057785,
			-0.001227322633387018,
			-0.0007626786605867574,
			-0.001766997093219806,
			-0.0028979771012721625,
			0.002400018742383494,
			0.00020767315392480586,
			-0.001642978972398152,
			0.0010105835131213243,
			-0.000885979915360855,
			0.0049633177350623305,
			-0.0016875363775485136,
			-0.0004636323945007214,
			-0.0008027232328246077,
			-6.7999060603004725e-06,
			-0.0016579187978452352,
			0.0003265289789883649,
			-0.002998945683774395,
			-0.0008551493726164782,
			-0.0005263221447650388,
			0.0004105261835036302,
			-6.732707141141671e-05,
			0.0050971442001487,
			0.0016996174588000325,
			-0.0034407600035260056,
			0.0028413115121841744,
			0.0033316335125052688,
			-0.000592152330403795,
			0.0020368995463395075,
			-0.002903171625659173,
			-0.0024734130520394585,
			0.0001699053840766752,
			-0.002859367085993785,
			0.0011294619041170124,
			-0.0011249781771326256,
			0.0011699473074362973,
			3.42462950110526e-05,
			0.003270934101022286,
			0.0021661991558192487,
			-0.0016500609042781693,
			-0.0009042768798334753,
			0.00067968658275336,
			0.001684448910249751,
			0.004449791593273233,
			-0.001733197097699002,
			0.0020836974009288745,
			-0.0009140476927698193,
			8.733267612163677e-05,
			-0.0001936235927974873,
			-0.0017175425862030276,
			-0.0024346114325540734,
			0.006139093062713971,
			0.0009586449270849833,
			-0.0009041959842073312,
			0.0033941146310054373,
			0.0032289463840282587,
			-0.0012493032653338937,
			0.0013585701011335637,
			-0.002072185358247858,
			0.0005185291208879836,
			-0.0005094923193941033,
			-0.0010261562452079118,
			-0.0001834645928015291,
			-0.002472023980457541,
			-0.0022381933171433215,
			0.0011715338751135057,
			-0.0007928120161904476,
			0.0029034513725149135,
			-0.000812428056612167,
			-0.000316871555442053,
			-0.0020370414230093947,
			0.00021336647084424805,
			-0.0016821016997950336,
			-0.0008712488984345691,
			-0.0011781186494600902,
			0.001875215644255925,
			0.004133219021702169,
			-0.0026605007731631213,
			0.002585560196345813,
			-0.0030240821289241318,
			-0.0003355644842668227,
			0.0012145152001478052,
			0.0004145946207422949,
			0.0003339440087725378,
			0.0007558093669549219,
			-0.002091910221846189,
			0.002105856792766297,
			0.0004257905046979737,
			0.0017676867976623714,
			0.0001764131661731039,
			0.005152851296850591,
			4.913780329177392e-05,
			-0.001885808434526818,
			0.002331316025530588,
			0.003242338174747513,
			-0.0008301552754876911,
			9.81669454338638e-05,
			0.006450496327179882,
			0.00279884395980827,
			-0.002738396485468326,
			-0.002888444026028092,
			-0.0011446004040370436,
			-0.002275698485530619,
			-0.0010862995802746178,
			0.004956905475204712,
			-0.002073737045946423,
			-0.0024220115116202353,
			-0.0027311376791020123,
			0.0007887885635188338,
			0.0017419762469182078,
			-4.9109123604942325e-06,
			0.0035670490937679774,
			-0.0026788132333019294,
			-0.0009586888216527016,
			8.34975429293114e-05,
			-0.0014370560628070939,
			0.0016984647697760832,
			-0.0020941159091443164,
			-0.0019375696158069175,
			-0.00019356168378133955,
			0.0014788783355780967,
			0.0021763885874181953,
			0.0020817120702525814,
			0.0027336009597559315,
			-0.0005159802310972931,
			0.0019396183432011502,
			-0.00275745108785543,
			0.0013723716137641112,
			0.000632829279011204,
			0.0017665870177952154,
			-0.0014518801715682724,
			0.0012345102657428566,
			7.594285882186373e-06,
			0.00540140743871611,
			0.009020702498332223,
			0.009018833120017365,
			-0.0007547613178669027,
			0.0010673635226797948,
			0.0006155108982637308,
			0.0010277337393771624,
			-0.0005776375457775446,
			0.0015053241939801466,
			-0.0025235751748391862,
			0.002285527569242095,
			-0.00036196983593691763,
			0.007099158347307661,
			0.0017098275120079746,
			-0.0003027759786672337,
			0.002714547535746484,
			-0.0013199385215440652,
			-0.00047759089649460534,
			-0.001588921368740346,
			0.0025546218909647156,
			-0.0002025429984173021,
			-0.0010965977761312937,
			0.0013438934074172593,
			0.0006801022554718205,
			0.00098579233262505,
			-0.001619401520888453,
			0.0005527361869703531,
			7.067532105050484e-05,
			-0.001443628110674984,
			0.00028661650288584967,
			0.0030324488459634335,
			0.0002655206263431926,
			0.0005206975714521541,
			0.0038512473889452834,
			0.00030329305078306785,
			0.00203809394993251,
			0.0026506853586324647,
			-0.0024675454383348444,
			-0.0012246631528532303,
			-0.0011007270471164944,
			0.0005389135813797475,
			-0.001453209617240752,
			-0.0006993234215407232,
			0.0013166160857405228,
			-0.0007927400173156128,
			-0.0010019161919417553,
			0.00018485205884388888,
			0.00031690861541936154,
			0.00010980856546797395,
			-0.002228326996697888,
			0.0008496053414164406,
			-0.0037016464535174704,
			0.00021665644234334367,
			-0.0005965730731024222,
			-0.0021342750196904144,
			0.00023459450244112302,
			0.0022623882385452198,
			0.0017034493072646394,
			0.0011417381247085087,
			-0.0010453641545281748,
			-0.002736434015318576,
			0.0015115435534153357,
			0.0019207884574332108,
			0.0005346645283057262,
			-0.0031348069713986455,
			-0.002450470981762343,
			-0.00011535445997768148,
			0.003569339859932931,
			0.0012746648984538584,
			-0.0018789767900611197,
			0.0007328470285821086,
			0.0005281221166359062,
			0.0024923316696449597,
			-0.00023655000543297653,
			0.0008855364918485751,
			0.0022610910804205385,
			-0.00012365856833910173,
			-0.0023436842774170854,
			-2.600272396053891e-05,
			0.007784460842298128,
			-0.0014575772740259372,
			-0.0018015078861432334,
			-0.0013113176284441767,
			0.0009725999823242209,
			-0.0012410431914725388,
			-0.0008576207840762297,
			0.00012897559981326422,
			-0.0034869816314411634,
			0.002035971220421426,
			0.0020714078646698556,
			-0.0025203629173465615,
			-0.0030638754710455374,
			-0.0010951993953658872,
			0.0010853729040852561,
			0.0007448589390651691,
			-0.0007828398185125445,
			0.002972518679414855,
			-0.0015745600088850201,
			-0.0017051188327288913,
			-0.002047247587571069,
			0.006708779740927323,
			0.0031841805238703967,
			0.0018231281702026385,
			0.005855225655982714,
			0.00016374837554925502,
			0.0016439776474623485,
			-0.002809571438645343,
			0.0008531039446796849,
			-0.0011717499895757756,
			0.003357430791844978,
			0.0001640465345558843,
			-0.0016564557241464666,
			-0.001180734058669511,
			-0.001146820467542585,
			0.003137191772100617,
			0.0022280587979431844,
			-0.00023698631449015303,
			0.002203583422658951,
			-0.0018077036780252851,
			0.005403399839658343,
			0.0011359507585223276,
			-0.002527484324878084,
			-0.00020668483385426906,
			-0.0011815181511623917,
			-0.00302589164565402,
			-0.0008867839224361367,
			0.0008124846187396968,
			-0.0016260104519770031,
			-0.001788090524628825,
			0.0002928583104154023,
			0.0011161733392804998,
			-0.0029546851119557982,
			0.003132640170563195,
			0.0008742555879449534,
			-0.0002039528683648631,
			0.0003598908536963449,
			0.0003570917059507767,
			-0.002009123063887321,
			0.005783939935305951,
			0.0008813593198116228,
			-0.00043787108513898825,
			-0.0005589054653551254,
			-0.003455761458124543,
			0.002403536906715842,
			-0.0013151527763662228,
			0.004391889414672126,
			0.0012164949924491108,
			0.0002330643201347957,
			0.0006307339467806424,
			-0.0028415577931144597,
			-0.0020072402520671757,
			0.0008484090524191871,
			-0.0003810948758484612,
			0.004213882271772296,
			-0.0016474895663931154,
			0.002100745461841862,
			-0.0011274393367067623,
			-0.002971339123380329,
			-0.0009189979983874435,
			0.00045159903754430584,
			0.002516337814946228,
			-0.0008777819420020169,
			-0.0005626096366006105,
			-0.0034268834282387152,
			-0.0018475367314737274,
			-0.001081868998122556
		]
	}
}
@DiegoPino DiegoPino self-assigned this May 6, 2024
@DiegoPino DiegoPino added Post processor Plugins The ones with a ->run() method Future Unknown but hopeful about what comes labels May 6, 2024
@DiegoPino DiegoPino added this to the 0.8.0 milestone May 6, 2024
@DiegoPino
Copy link
Member Author

Resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Future Unknown but hopeful about what comes Post processor Plugins The ones with a ->run() method
Projects
None yet
Development

No branches or pull requests

1 participant