more face info

This commit is contained in:
Ruben 2016-09-15 14:01:46 +01:00
parent 9a60a69f22
commit 3103998514

View file

@ -3,6 +3,7 @@ require __DIR__ . '/../bootstrap.php';
error_reporting(E_ALL);ini_set('display_errors', true);
$em = \EmotionHero\Application::getInstance()->getEm();
/* @var $hitRepo EmotionHero\Models\HitRepository */
$hitRepo = $em->getRepository(\EmotionHero\Models\Hit::class);
/* @var $currentHit \EmotionHero\Models\Hit */
@ -93,6 +94,7 @@ text-align:center;
}
dd, dt{
float:left;width:80px;
text-align:left;
}
img.curImg{
position:absolute;
@ -101,7 +103,7 @@ dd, dt{
}
svg{
width:400px;
width:300px;
float:left;
}
@ -119,42 +121,50 @@ echo "</dl>";
echo "</div>";
echo "<div class='brows emo'><h3>eye brows</h3>";
echo "<div class='emo-block'>anger<div class='emo-block-emos'>";
$printEmoBlocks('anger','brows');
echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getAnger()}%\">";
echo "</div></div>";
echo "<div class='emo-block'>joy<div class='emo-block-emos'>";
$printEmoBlocks('joy','brows');
echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getJoy()}%\">";
echo "</div></div>";
echo "<div class='emo-block'>sadness<div class='emo-block-emos'>";
$printEmoBlocks('sadness','brows');
echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getSadness()}%\">";
foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) {
echo "<div class='emo-block'>$emotion<div class='emo-block-emos'>";
$printEmoBlocks($emotion, 'brows');
echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getEmotionScore($emotion)}%\">";
echo "</div></div>";
}
echo "<div class='emo-block'>surprise<div class='emo-block-emos'>";
$printEmoBlocks('surprise','brows');
echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getSurprise()}%\">";
echo "</div></div>";
echo "</div>"; // .brows
//
//echo "<div class='emo-block'>joy<div class='emo-block-emos'>";
//$printEmoBlocks('joy','brows');
//echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getJoy()}%\">";
//echo "</div></div>";
//
//echo "<div class='emo-block'>sadness<div class='emo-block-emos'>";
//$printEmoBlocks('sadness','brows');
//echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getSadness()}%\">";
//echo "</div></div>";
//
//echo "<div class='emo-block'>surprise<div class='emo-block-emos'>";
//$printEmoBlocks('surprise','brows');
//echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getSurprise()}%\">";
//echo "</div></div>";
//echo "</div>"; // .brows
echo "<div class='nose emo'><h3>nose</h3>";
echo "<div class='emo-block'>anger";
$printEmoBlocks('joy','nose');
echo "</div>";
foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) {
echo "<div class='emo-block'>$emotion<div class='emo-block-emos'>";
$printEmoBlocks($emotion, 'nose');
echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("nose")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getEmotionScore($emotion)}%\">";
echo "</div></div>";
}
echo "<div class='emo-block'>joy";
$printEmoBlocks('disgust','nose');
echo "</div>";
echo "<div class='emo-block'>sadness";
$printEmoBlocks('sadness','nose');
echo "</div>";
echo "</div>"; // .nose
foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) {
echo "<div class='emo-block'>$emotion<div class='emo-block-emos'>";
$printEmoBlocks($emotion, 'mouth_right');
echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("mouth_right")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getEmotionScore($emotion)}%\">";
echo "</div></div>";
}
$circles = "";
foreach($currentHit->getPoints()->getNormalisedPoints() as $i => $point) {
$circles .= '<circle
@ -165,6 +175,15 @@ foreach($currentHit->getPoints()->getNormalisedPoints() as $i => $point) {
r="1" />';
}
foreach($hitRepo->getBetterHit($currentHit)->getPoints()->getNormalisedPoints() as $i => $point) {
$circles .= '<circle
style="fill:#66ff00;"
id="point'.$i.'"
cx="'.$point->getX().'"
cy="'.$point->getY().'"
r="1" />';
}
echo <<< EOSVG
<svg
xmlns:svg="http://www.w3.org/2000/svg"