more face info
This commit is contained in:
parent
9a60a69f22
commit
3103998514
1 changed files with 48 additions and 29 deletions
|
@ -3,6 +3,7 @@ require __DIR__ . '/../bootstrap.php';
|
||||||
error_reporting(E_ALL);ini_set('display_errors', true);
|
error_reporting(E_ALL);ini_set('display_errors', true);
|
||||||
|
|
||||||
$em = \EmotionHero\Application::getInstance()->getEm();
|
$em = \EmotionHero\Application::getInstance()->getEm();
|
||||||
|
/* @var $hitRepo EmotionHero\Models\HitRepository */
|
||||||
$hitRepo = $em->getRepository(\EmotionHero\Models\Hit::class);
|
$hitRepo = $em->getRepository(\EmotionHero\Models\Hit::class);
|
||||||
|
|
||||||
/* @var $currentHit \EmotionHero\Models\Hit */
|
/* @var $currentHit \EmotionHero\Models\Hit */
|
||||||
|
@ -93,6 +94,7 @@ text-align:center;
|
||||||
}
|
}
|
||||||
dd, dt{
|
dd, dt{
|
||||||
float:left;width:80px;
|
float:left;width:80px;
|
||||||
|
text-align:left;
|
||||||
}
|
}
|
||||||
img.curImg{
|
img.curImg{
|
||||||
position:absolute;
|
position:absolute;
|
||||||
|
@ -101,7 +103,7 @@ dd, dt{
|
||||||
}
|
}
|
||||||
|
|
||||||
svg{
|
svg{
|
||||||
width:400px;
|
width:300px;
|
||||||
float:left;
|
float:left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,42 +121,50 @@ echo "</dl>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
|
||||||
echo "<div class='brows emo'><h3>eye brows</h3>";
|
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'>";
|
foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) {
|
||||||
$printEmoBlocks('sadness','brows');
|
echo "<div class='emo-block'>$emotion<div class='emo-block-emos'>";
|
||||||
echo "<img class='curImg' src=\"data:image/x-icon;base64,{$currentHit->getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getSadness()}%\">";
|
$printEmoBlocks($emotion, 'brows');
|
||||||
echo "</div></div>";
|
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='nose emo'><h3>nose</h3>";
|
||||||
echo "<div class='emo-block'>anger";
|
foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) {
|
||||||
$printEmoBlocks('joy','nose');
|
echo "<div class='emo-block'>$emotion<div class='emo-block-emos'>";
|
||||||
echo "</div>";
|
$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
|
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 = "";
|
$circles = "";
|
||||||
foreach($currentHit->getPoints()->getNormalisedPoints() as $i => $point) {
|
foreach($currentHit->getPoints()->getNormalisedPoints() as $i => $point) {
|
||||||
$circles .= '<circle
|
$circles .= '<circle
|
||||||
|
@ -165,6 +175,15 @@ foreach($currentHit->getPoints()->getNormalisedPoints() as $i => $point) {
|
||||||
r="1" />';
|
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
|
echo <<< EOSVG
|
||||||
<svg
|
<svg
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
|
Loading…
Reference in a new issue