You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great plugin!! :)
I extended it to also work with CompreFace which is a facial recognition algorithm that can run locally. Below the code. It will need to be refined a bit here and there (I am far from a professional) and I am more than happy to help doing so. I can also write a tutorial or something if needed.
Best, J
`<?php
class CompreFace extends API {
function getInfo() : array
{
return [
"icon" => 'https://user-images.githubusercontent.com/3736126/147130206-17234c47-8d40-490f-8d93-57014fa6d87e.png',
"site" => 'https://exadel.com/solutions/compreface/',
"info" => `
CompreFace is an open-source face recognition service that can be run on premises
`,
];
}
function getConfParams() : array
{
return [
'ENDPOINT' => 'API Endpoint',
'KEY'=> 'API Key'
];
}
function generateTags($conf, $params) : array
{
global $logger;
$file_path = $this->getFileName($params['imageId']);
$url ='http://'.$conf["ENDPOINT"].'/api/v1/recognition/recognize?limit=0&det_prob_threshold=0.6&prediction_count=1&face_plugins=landmarks,%20gender,%20age,%20calculator&status=true';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE($file_path)),
CURLOPT_HTTPHEADER => array(
'Content-Type: multipart/form-data',
'x-api-key: '.$conf["KEY"]
),
));
if (curl_errno($curl))
{
return [curl_error($curl)];
}
$response = curl_exec($curl);
curl_close($curl);
$json_response = json_decode($response);
$tags = [];
$json_result = $json_response->result;
foreach ($json_result as $result) {
if($result->subjects[0]->similarity > 0.65)
array_push($tags,$result->subjects[0]->subject);
$logger->info("Found " . $result->subjects[0]->subject);
}
return $tags;
}
}`
The text was updated successfully, but these errors were encountered:
Some specific issues that I ran into using CompreFace that need to be resolved. I would benefit from a bit of help here :) @Zacharieg, would you be able to help out?
Detailed description: when running the plugin from the Batch Manager (for a single or multiple photos), an error is returned, while the images are correctly processed and tags correctly added to the figure.
Issue 2 - success message despite plugin not running for second selection
Detailed description: when running the plugin from the Batch Manager (after a successful run) on a new selection, a success message is provided, but no photos are tagged.
Issue 3 - plugin hanging on 'Loading...'
Detailed description: when running the plugin from a photo page ('Edit photo'), the plugin hangs on 'Loading..' and no tagging takes place.
Great plugin!! :)
I extended it to also work with CompreFace which is a facial recognition algorithm that can run locally. Below the code. It will need to be refined a bit here and there (I am far from a professional) and I am more than happy to help doing so. I can also write a tutorial or something if needed.
Best, J
`<?php
class CompreFace extends API {
}`
The text was updated successfully, but these errors were encountered: