DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

Cover image for How to Cook a Thanksgiving Turkey According to Amazon Rekognition

How to Cook a Thanksgiving Turkey According to Amazon Rekognition

You can find all the details and original steps on how to cook a Thanksgiving turkey on wikiHow.

This is a tech recipe using Amazon Rekognition, a service that simplifies operational media analysis tasks by providing fully managed, purpose-built APIs powered by ML. At your peril, if you do not understand how the APIs work and how to manage confidence levels.

The Amazon Rekognition Recipe

  • Thaw out your soccer ball in the refrigerator several days before Thanksgiving. It is just about time, the FIFA World Cup in Qatar is starting very soon.

Turkey soccer ball

  • Take a chicken out of the fridge an hour before your scheduled cook time. Turkey costs twice as much as chicken, a sensible and recession-proof option in 2022.

Turkey chicken

  • Preheat your dishwater to 350 ยฐF (177 ยฐC).

Turkey dishwater

  • Tie the catโ€™s legs together. Sometimes life calls for tough choices.

Turkey cat

  • Wrap the cat in aluminum foil, and keep it as a surprise for your guests.

Turkey aluminium foil

  • Cook some bread for 13 minutes for every 1 lb (0.45 kg) of wheat. Fill it with dynamite instead of traditional stuffing. Surprise everyone.

Turkey bread and dynamite

  • Hurry up, order online, wait 20 minutes and serve some pork. You did not cook your cat, right?

Turkey pork

After-Dinner Treats

I do not plan to cook pork, a chicken, or a cat. Or even a turkey. I am vegetarian.

This is a parody, you can read the steps on how to really cook a Thanksgiving turkey on wikiHow which owns the rights to the seven images used in this unconventional test. All the screenshots above are taken from the Amazon Rekognition console.

Given the low quality of the images, the weird challenge, and the likely little training of the algorithm for turkeys, Amazon Rekognition did remarkably well in labeling images. But always remember to validate the results of your ML data, specifying a safe minimum confidence level while making API requests to Amazon Rekognition or you might end up cooking a cat.

Each label has an associated level of confidence, a number between 0 and 100 that indicates the probability that a given prediction is correct, do not just pick the first or highest label in the result set. Understanding the BoundingBox is critical too: the dimensions of the bounding box would have been enough to easily discard the cat labeling of our dish given the small relative size:

    "BoundingBox": {
        "Width": 0.0804702416062355,
        "Height": 0.09522213786840439,
        "Left": 0.4962283670902252,
        "Top": 0.7688567638397217
    }
Enter fullscreen mode Exit fullscreen mode

Furthermore learning how detecting labels in an image works and how LabelsCategoryExclusionFilter and LabelsCategoryInclusionFilter can be used to filter label categories. AWS recommends:

using a threshold of 99% or more for use cases where the accuracy of classification could have any negative impact on the subjects of the images

Now go out and play with that frozen 99.7% soccer ball.

Happy Thanksgiving! ๐Ÿฝ

Questions? Comments? Contact me.

Top comments (7)

Collapse
 
cicirello profile image
Vincent A. Cicirello

This is awesome. One of the more unique #jokes posts.

Collapse
 
cloudiamo profile image
Renato Losio ๐Ÿ’ญ๐Ÿ’ฅ

Thanks Vincent, really appreciated.

Collapse
 
dvddpl profile image
Davide de Paolis

this is absolutely fantastic. genius!

Collapse
 
cloudiamo profile image
Renato Losio ๐Ÿ’ญ๐Ÿ’ฅ

Thank you Davide!

Collapse
 
perssondennis profile image
Dennis Persson

I love seeing people using the #jokes tag, and you did it in a brilliant way @cloudiamo ๐Ÿ˜€

Collapse
 
cloudiamo profile image
Renato Losio ๐Ÿ’ญ๐Ÿ’ฅ

Thanks Dennis!

Collapse
 
codenameone profile image
Shai Almog

I'm thawing my soccer ball and heating my dishwasher right now... Yum.

Top Heroku Alternatives (For Free!)

Recently Heroku shut down free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis on November 28th, 2022. So Meshv Patel put together some free alternatives in this classic DEV post.