Comments (6)
Hi, @ZaidSaid12
Thank you for the interest. You can take a look at my Medium Article for more details.
from deep-learning.
@arnaldog12
First of all, thanks for your quick response, greatly appreciated
I've already read your article before checking the code, you mentioned that you used amazon face detection API, so can you please provide the code for generating the dataset {samples.pkl}, i already followed the hyper link of amazon's api
from deep-learning.
I intend to increase the accuracy of this model, but it seems i might need a larger dataset
from deep-learning.
Hi, @ZaidSaid12
I'm sorry. I looked for the code that generates the dataset this weekend, but I don't have it anymore.
but, I still have the code to work with API. I don't know if still works, but you can try:
import boto3
class AmazonAPI():
def __init__(self, region='us-east-2'):
self._api = boto3.client("rekognition", region)
def classify_image(self, image_file):
return self._api.detect_labels(Image={'Bytes': open(image_file, 'rb').read()})
def detect_faces(self, image_file):
return self._api.detect_faces(Image={'Bytes': open(image_file, 'rb').read()})
def to_rects(self, json_res, img_size=None):
assert(img_size), "You must provide img_size as (height, width)"
assert(len(img_size) == 2), 'img_size must be (height, width)'
height, width = img_size
rects = []
for details in json_res['FaceDetails']:
rect = details['BoundingBox']
rect_x, rect_y = int(rect['Left']*width), int(rect['Top']*height)
rect_w, rect_h = int(rect['Width']*width), int(rect['Height']*height)
rects.append(Rect(rect_x, rect_y, rect_w, rect_h))
return rects
and the code to parse Amazon responses:
def parser_amazon(json_file):
pose_dict = json_file['FaceDetails'][0]['Pose']
return pose_dict['Roll'], pose_dict['Pitch'], pose_dict['Yaw']
I hope it helps!
from deep-learning.
@ZaidSaid12, just to make sure you get the edited code.
from deep-learning.
@arnaldog12
Thank you, greatly appreciated
from deep-learning.
Related Issues (10)
- [solved] google drive link for data shows error HOT 2
- Ho to find yaw, roll, and pitch for the training data? HOT 1
- Samples.pkl not found HOT 13
- FPS issue for the real-time experinece in Webcam HOT 7
- samples.rar and samples_old.rar error while extracting HOT 1
- SOTA for Head Pose Estimation on AFLW2000 dataset
- Model file missing HOT 1
- Question: Re-training using 5 landmark points HOT 2
- Is there a C++ evaluation file of this model?? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep-learning.