<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mitch</title>
    <description>The latest articles on Forem by Mitch (@mitchh_emery).</description>
    <link>https://forem.com/mitchh_emery</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4634%2FJ1vLWqGP.jpg</url>
      <title>Forem: Mitch</title>
      <link>https://forem.com/mitchh_emery</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mitchh_emery"/>
    <language>en</language>
    <item>
      <title>Python Celebrity Recognizer</title>
      <dc:creator>Mitch</dc:creator>
      <pubDate>Sat, 21 Apr 2018 01:59:03 +0000</pubDate>
      <link>https://forem.com/mitchh_emery/python-celebrity-recognizer-5120</link>
      <guid>https://forem.com/mitchh_emery/python-celebrity-recognizer-5120</guid>
      <description>&lt;h4&gt;
  
  
  Let's use the python requests library, and a free trial of Microsoft's computer vision API to identify celebrities in photos.
&lt;/h4&gt;

&lt;p&gt;This short tutorial is aimed at showing developers how accessible and user friendly cognitive services can be. This tutorial is taken largely inpart from Microsoft's Cognitive Services documentation, it can be found &lt;a href="https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts/python"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To start, your going to need a free subscription key from &lt;a href="https://azure.microsoft.com/en-us/try/cognitive-services/?api=computer-vision"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;First&lt;/em&gt;, we need to import the requests library&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;requests&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we need the keys, and some basic URL's. We're going to use these values from the computer vision API documentation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;#subscription key
&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"your key here"&lt;/span&gt;

&lt;span class="c1"&gt;#Base endpoint and special celebrity endpoint
&lt;/span&gt;&lt;span class="n"&gt;vision_base_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://westcentralus.api.cognitive.microsoft.com/vision/v1.0/"&lt;/span&gt;
&lt;span class="n"&gt;celebrity_analyze_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vision_base_url&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"models/celebrities/analyze"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next we need an image of a celebrity.I'll start with the king of pop.&lt;br&gt;
&lt;a href="http://images2.fanpop.com/image/photos/10700000/Close-Up-Large-Photo-michael-jackson-10731676-1267-1333.jpg"&gt;Micheal Jackson&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;image_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"http://images2.fanpop.com/image/photos/10700000/Close-Up-Large-Photo-michael-jackson-10731676-1267-1333.jpg"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We're going to need some basic HTTP variables set up. These values are standard and have been taken from the documentation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'Ocp-Apim-Subscription-Key'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'visualFeatures'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;'Categories,Description,Color'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'url'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;image_url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We finally send the request to the service.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;celebrity_analyze_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;analysis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's look at our results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"celebrities"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Micheal Jackson&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Comment which celebrities the service can and can't recognize.&lt;/p&gt;

&lt;p&gt;I've got the first one, this service can't recognize Prince...&lt;/p&gt;

</description>
      <category>python</category>
      <category>microsoft</category>
    </item>
    <item>
      <title>Today, I met Tim Cook</title>
      <dc:creator>Mitch</dc:creator>
      <pubDate>Wed, 24 Jan 2018 00:24:07 +0000</pubDate>
      <link>https://forem.com/mitchh_emery/today-i-met-tim-cook-1g9g</link>
      <guid>https://forem.com/mitchh_emery/today-i-met-tim-cook-1g9g</guid>
      <description>&lt;p&gt;Apple's CEO, &lt;strong&gt;Tim Cook&lt;/strong&gt; , is visiting schools across the globe, and today he made his way to Sheridan College, in Oakville, Ontario Canada. &lt;/p&gt;

&lt;p&gt;I am a student in Sheridan's Bachelor Of Applied Computer Science - Mobile Computing program. What makes my program different is the applied nature of the degree. My program strikes a balance between academia and hands on experience. &lt;/p&gt;

&lt;p&gt;I think this is what drew Tim to our school, and is why he visited my class. I owe him a great deal of thanks, because Tim's visit renewed my passion for computer science.&lt;/p&gt;

&lt;p&gt;Although Tim was with us only for a short time, I was lucky enough to talk to him about a project a teammate and I are working on. He shared many things with us, and with our class, but two really stood out to me, and I thought I'd share them with you.&lt;/p&gt;

&lt;h5&gt;
  
  
  The Importance of Team Commitment
&lt;/h5&gt;

&lt;p&gt;Tim said that our two man team is a lot like a marriage. I'd take that further and say all teams have marriage-like qualities. For me, Tim's words emulate a care that each teammate has to have for each other.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Regardless of a teammate's willingness to accept help, you need to look after each other.&lt;/li&gt;
&lt;li&gt;You need to have the courage to pull each other back in when you stray from the path.&lt;/li&gt;
&lt;li&gt;You need to have difficult conversations. &lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  The Importance of Simplicity
&lt;/h5&gt;

&lt;p&gt;Tim made a point of saying that Apple tries to make Swift as simple as their other products. Simplicity is a common theme that re-occurs in all my classes. It's been repeated so many times it's almost lost meaning. It seems as if this goal of simplicity is unattainable, constantly out of reach. Hearing the CEO of Apple reiterate it's importance, solidified to me that this theme goes all the way to the top. Making something as simple as possible is a key ingredient for success.&lt;/p&gt;

&lt;p&gt;Seeing passion in someone ignites your own passion. Seeing Tim's passion ignited my own, but Tim's interest in our projects showed me his passion is also reignited as he visits future computer scientists. &lt;/p&gt;

&lt;p&gt;Today's Selfie: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fauhxqeuwd4ue6tct1l6t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fauhxqeuwd4ue6tct1l6t.jpg" title="My teammate, Tim Cook, and I" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>school</category>
      <category>ios</category>
      <category>career</category>
    </item>
  </channel>
</rss>
