Mudanças entre as edições de "Oficina de Computacao Cognitiva"

De LHC
Ir para navegação Ir para pesquisar
Linha 110: Linha 110:
  
 
[[Arquivo:watson-classificacao-2-1.png]]
 
[[Arquivo:watson-classificacao-2-1.png]]
 +
 +
 +
 +
Para trabalhar no NodeRed com reconhecimento de imagem, classificacao ou deteccao de texto, inicie um novo app no Watson IoT Platform e associe ele ao Visual Recognition do Watson.
 +
 +
 +
[[Arquivo:visual-recognition-ibm-watson-1.png]]
 +
 +
Crie o seguinte aplicativo em Node Red:
 +
 +
[[Arquivo:visual-recognition-ibm-watson-2.png]]
 +
 +
Para cria-lo de forma rapida, copie e cole o JSON abaixo na sessao import -> clipboard.
 +
 +
 +
[
 +
    {
 +
        "id": "dba7f7ca.9b6f58",
 +
        "type": "tab",
 +
        "label": "Flow 1"
 +
    },
 +
    {
 +
        "id": "a9bb9560.630f5",
 +
        "type": "ibmiot",
 +
        "z": "",
 +
        "name": "",
 +
        "keepalive": "60",
 +
        "domain": "",
 +
        "cleansession": true,
 +
        "appId": "",
 +
        "shared": false
 +
    },
 +
    {
 +
        "id": "d7501fec.f671",
 +
        "type": "ibmiot",
 +
        "z": "",
 +
        "name": "",
 +
        "keepalive": "60",
 +
        "domain": "",
 +
        "cleansession": true,
 +
        "appId": "",
 +
        "shared": false
 +
    },
 +
    {
 +
        "id": "53a902f7.0483e4",
 +
        "type": "ibmiot",
 +
        "z": "",
 +
        "name": "iot-lhc",
 +
        "keepalive": "60",
 +
        "domain": "",
 +
        "cleansession": true,
 +
        "appId": "",
 +
        "shared": false
 +
    },
 +
    {
 +
        "id": "997d054e.50b3",
 +
        "type": "inject",
 +
        "z": "dba7f7ca.9b6f58",
 +
        "name": "URL",
 +
        "topic": "",
 +
        "payload": "http://r.ddmcdn.com/s_f/o_1/cx_633/cy_0/cw_1725/ch_1725/w_720/APL/uploads/2014/11/too-cute-doggone-it-video-playlist.jpg",
 +
        "payloadType": "str",
 +
        "repeat": "",
 +
        "crontab": "",
 +
        "once": false,
 +
        "x": 383.5,
 +
        "y": 105.5,
 +
        "wires": [
 +
            [
 +
                "1f0ef5e5.bbc442"
 +
            ]
 +
        ]
 +
    },
 +
    {
 +
        "id": "1f0ef5e5.bbc442",
 +
        "type": "visual-recognition-v3",
 +
        "z": "dba7f7ca.9b6f58",
 +
        "name": "Classify an image",
 +
        "apikey": "__PWRD__",
 +
        "image-feature": "classifyImage",
 +
        "lang": "en",
 +
        "x": 777.5,
 +
        "y": 104.5,
 +
        "wires": [
 +
            [
 +
                "e817c082.941738"
 +
            ]
 +
        ]
 +
    },
 +
    {
 +
        "id": "dcc39aab.4a483",
 +
        "type": "inject",
 +
        "z": "dba7f7ca.9b6f58",
 +
        "name": "URL",
 +
        "topic": "",
 +
        "payload": "https://sd.keepcalm-o-matic.co.uk/i-w600/too-much-love-will-kill-you-everytime.jpg",
 +
        "payloadType": "str",
 +
        "repeat": "",
 +
        "crontab": "",
 +
        "once": false,
 +
        "x": 383,
 +
        "y": 187.5,
 +
        "wires": [
 +
            [
 +
                "b062078e.4eb698"
 +
            ]
 +
        ]
 +
    },
 +
    {
 +
        "id": "b062078e.4eb698",
 +
        "type": "visual-recognition-v3",
 +
        "z": "dba7f7ca.9b6f58",
 +
        "name": "Recognize Text",
 +
        "apikey": "__PWRD__",
 +
        "image-feature": "recognizeText",
 +
        "x": 788,
 +
        "y": 186.5,
 +
        "wires": [
 +
            [
 +
                "e817c082.941738"
 +
            ]
 +
        ]
 +
    },
 +
    {
 +
        "id": "3eeb983b.ffbf1",
 +
        "type": "visual-recognition-v3",
 +
        "z": "dba7f7ca.9b6f58",
 +
        "name": "Detect Faces",
 +
        "apikey": "__PWRD__",
 +
        "image-feature": "detectFaces",
 +
        "x": 769.5,
 +
        "y": 294.5,
 +
        "wires": [
 +
            [
 +
                "e817c082.941738"
 +
            ]
 +
        ]
 +
    },
 +
    {
 +
        "id": "4c738167.7a20a8",
 +
        "type": "inject",
 +
        "z": "dba7f7ca.9b6f58",
 +
        "name": "URL",
 +
        "topic": "",
 +
        "payload": "http://hypescience.com/wp-content/uploads/2016/07/obama.jpg",
 +
        "payloadType": "str",
 +
        "repeat": "",
 +
        "crontab": "",
 +
        "once": false,
 +
        "x": 386,
 +
        "y": 294.5,
 +
        "wires": [
 +
            [
 +
                "3eeb983b.ffbf1"
 +
            ]
 +
        ]
 +
    },
 +
    {
 +
        "id": "e817c082.941738",
 +
        "type": "debug",
 +
        "z": "dba7f7ca.9b6f58",
 +
        "name": "",
 +
        "active": true,
 +
        "console": "false",
 +
        "complete": "result",
 +
        "x": 1087.5,
 +
        "y": 150.5,
 +
        "wires": []
 +
    }
 +
]
 +
 +
  
  

Edição das 04h59min de 5 de abril de 2017

Sobre

Oficina de Computação Cognitiva acontece todas as Terças-feiras em dias úteis, com a finalidade de reunir pessoas com interesse em desenvolver, testar e criar diferentes tipos de projetos que envolva Computação Cognitiva, Machine Learning e Inteligencia Artificial.

As atividades são gratuitas e o espaço é mantido pelos sócios do Laboratório Hacker de Campinas.

No primeiro semestre de 2017 abordaremos alguns tópicos:

  • Estudo do IBM Watson como plataforma inteligente
  • Indrotução ao NodeRed
  • Sistemas Embarcados e IoT Watson Plataform - Intel Edison, 410C e Raspberry Pi.

Oficina de Computação Cognitiva Primeira Temporada 2017

Projetos

10/01/2017 (Terca-Feira)

  • Pizza grátis e apresentação dos interessados
  • Estudo da plataforma IBM Watson - O que é?
  • A oficina começa com estudo do IBM Bluemix e Watson IoT Plataform.

17/01/2017 (Terca-Feira)

  • Pizza gratis e apresentacao dos interessados
  • Sensor TAG da Texas Instruments no IBM Bluemix

24/01/2017 (Terça-Feira)

  • Entenda o IBM Watson - Gisele Consoline da IBM
  • Conectando o Arduino ao IBM Watson - Erik Andersen da IBM

31/01/2017 (Terca-Feira)

  • Conectando a Intel Edison ao IBM Watson

07/02/2017 (Terca-Feira)

  • Noções de desenvolvimento de uma aplicação de nodeRed recebendo dados do NodeLHC (ESP8266)

14/02/2017 (Terca-Feira)

  • BOT usando o Messenger para uma pizzaria com atendente utilizando o Watson

23/02/2017 (Terca-Feira)

  • Continucao - BOT usando o Messenger para uma pizzaria com atendente utilizando o Watson

23/02/2017 (Terca-Feira)

  • Continucao - BOT usando o Messenger para uma pizzaria com atendente utilizando o Watson - apresentaco de como fazer um Chatbot com Watson.

07/03/2017 (Terca-Feira)

  • BOT usando o Messenger para uma pizzaria com atendente utilizando o Watson - Integracao com o Facebook

14/03/2017 (Terca-Feira)

  • BOT usando o Messenger para uma pizzaria com atendente utilizando o Watson - Correcao de bugs

21/03/2017 (Terca-Feira)

  • Integrar e usar o Speech to Text e o Text to speech com o BOT

28/03/2017 (Terca-Feira)

  • Conectar Raspberry Pi no Watson - IoT Platform

https://developer.ibm.com/recipes/tutorials/raspberry-pi-4/

04/04/2017 (Terca-Feira)


Para reconhecimento de imagem:

Dentro do IBM Bluemix:

Criar um app de Visual Recognition

Clique em Service Credentials View Credentials

{

 "url": "https://gateway-a.watsonplatform.net/visual-recognition/api",
 "note": "It may take up to 5 minutes for this key to become active",
 "api_key": "9e27a30f3c6e32e42cd6cbbacf5006451c333efx"

}


No Terminal de comando, no linux:

Para instalar:

$ npm install watson-developer-cloud --save


Comandos para Classificacao de imagem:

$ image_url=http://r.ddmcdn.com/s_f/o_1/APL/uploads/2015/07/cecil-AP463227356214-1000x400.jpg

$ api_key=9e27a30f3c6e32e42cd6cbbacf5006451c333efx

$ curl -X GET "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key=${api_key}&version=2016-05-20&url=${image_url}"


Resultado:

Watson-classificacao-1-1.png


Comandos para reconhecimento de imagem:

$ image_url=http://hypescience.com/wp-content/uploads/2016/07/obama.jpg

$ api_key=9e27a30f3c6e32e42cd6cbbacf5006451c333efx

$ curl -X GET "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/detect_faces?api_key=${api_key}&version=2016-05-20&url=${image_url}"


Resultado:

Watson-classificacao-2-1.png


Para trabalhar no NodeRed com reconhecimento de imagem, classificacao ou deteccao de texto, inicie um novo app no Watson IoT Platform e associe ele ao Visual Recognition do Watson.


Visual-recognition-ibm-watson-1.png

Crie o seguinte aplicativo em Node Red:

Visual-recognition-ibm-watson-2.png

Para cria-lo de forma rapida, copie e cole o JSON abaixo na sessao import -> clipboard.


[

   {
       "id": "dba7f7ca.9b6f58",
       "type": "tab",
       "label": "Flow 1"
   },
   {
       "id": "a9bb9560.630f5",
       "type": "ibmiot",
       "z": "",
       "name": "",
       "keepalive": "60",
       "domain": "",
       "cleansession": true,
       "appId": "",
       "shared": false
   },
   {
       "id": "d7501fec.f671",
       "type": "ibmiot",
       "z": "",
       "name": "",
       "keepalive": "60",
       "domain": "",
       "cleansession": true,
       "appId": "",
       "shared": false
   },
   {
       "id": "53a902f7.0483e4",
       "type": "ibmiot",
       "z": "",
       "name": "iot-lhc",
       "keepalive": "60",
       "domain": "",
       "cleansession": true,
       "appId": "",
       "shared": false
   },
   {
       "id": "997d054e.50b3",
       "type": "inject",
       "z": "dba7f7ca.9b6f58",
       "name": "URL",
       "topic": "",
       "payload": "http://r.ddmcdn.com/s_f/o_1/cx_633/cy_0/cw_1725/ch_1725/w_720/APL/uploads/2014/11/too-cute-doggone-it-video-playlist.jpg",
       "payloadType": "str",
       "repeat": "",
       "crontab": "",
       "once": false,
       "x": 383.5,
       "y": 105.5,
       "wires": [
           [
               "1f0ef5e5.bbc442"
           ]
       ]
   },
   {
       "id": "1f0ef5e5.bbc442",
       "type": "visual-recognition-v3",
       "z": "dba7f7ca.9b6f58",
       "name": "Classify an image",
       "apikey": "__PWRD__",
       "image-feature": "classifyImage",
       "lang": "en",
       "x": 777.5,
       "y": 104.5,
       "wires": [
           [
               "e817c082.941738"
           ]
       ]
   },
   {
       "id": "dcc39aab.4a483",
       "type": "inject",
       "z": "dba7f7ca.9b6f58",
       "name": "URL",
       "topic": "",
       "payload": "https://sd.keepcalm-o-matic.co.uk/i-w600/too-much-love-will-kill-you-everytime.jpg",
       "payloadType": "str",
       "repeat": "",
       "crontab": "",
       "once": false,
       "x": 383,
       "y": 187.5,
       "wires": [
           [
               "b062078e.4eb698"
           ]
       ]
   },
   {
       "id": "b062078e.4eb698",
       "type": "visual-recognition-v3",
       "z": "dba7f7ca.9b6f58",
       "name": "Recognize Text",
       "apikey": "__PWRD__",
       "image-feature": "recognizeText",
       "x": 788,
       "y": 186.5,
       "wires": [
           [
               "e817c082.941738"
           ]
       ]
   },
   {
       "id": "3eeb983b.ffbf1",
       "type": "visual-recognition-v3",
       "z": "dba7f7ca.9b6f58",
       "name": "Detect Faces",
       "apikey": "__PWRD__",
       "image-feature": "detectFaces",
       "x": 769.5,
       "y": 294.5,
       "wires": [
           [
               "e817c082.941738"
           ]
       ]
   },
   {
       "id": "4c738167.7a20a8",
       "type": "inject",
       "z": "dba7f7ca.9b6f58",
       "name": "URL",
       "topic": "",
       "payload": "http://hypescience.com/wp-content/uploads/2016/07/obama.jpg",
       "payloadType": "str",
       "repeat": "",
       "crontab": "",
       "once": false,
       "x": 386,
       "y": 294.5,
       "wires": [
           [
               "3eeb983b.ffbf1"
           ]
       ]
   },
   {
       "id": "e817c082.941738",
       "type": "debug",
       "z": "dba7f7ca.9b6f58",
       "name": "",
       "active": true,
       "console": "false",
       "complete": "result",
       "x": 1087.5,
       "y": 150.5,
       "wires": []
   }

]



Links de Referencia para Classificacao de imagens e Reconhecimento de faces:

https://watson-api-explorer.mybluemix.net/apis/visual-recognition-v3?cm_mc_uid=95153737794014878920994&cm_mc_sid_50200000=1490747250&cm_mc_sid_52640000=1490748126#/

https://www.youtube.com/watch?v=U-yJYHks1_s

https://www.npmjs.com/package/watson-developer-cloud


Detalhes

Alguns Materiais utilizados para estudar o Bluemix estão apresentados a seguir:

Materiais em Português

Excelentes video de Priscila Parodi

Video 1 - Como criar um chatbot https://www.youtube.com/watch?v=WrLQDN-gxB4

Video 2 - Como criar um chatbot https://www.youtube.com/watch?v=k-tz6tybk3o

Video 3 - Como criar um chatbot https://www.youtube.com/watch?v=hSnwfLMxCoQ&t=728s

Video 4 - Como criar um chatbot https://www.youtube.com/watch?v=get-QWhF0A0

Playlist de vídeos com Tutoriais e Introdução ao Bluemix: https://www.youtube.com/watch?v=zFOQaH7AM3g

Vídeo-aulas Bluemix (Oficina do Futuro): https://www.youtube.com/playlist?list=PL6PIlsA8-TZU-up5H6Cj3QOHSKEK_HGZv

GIT HUB úteis

https://github.com/watson-developer-cloud/python-sdk

https://github.com/ibm-watson-iot/iot-python

Materiais em Inglês

Vídeos sobre o Bluemix (IBMEtinfo): https://www.youtube.com/playlist?list=PL78F74113FAACEA34

Curso do Coursera - A developer's guide to the Internet of Things (IoT) https://www.coursera.org/learn/developer-iot?utm_campaign=Coursera+Promotion&utm_medium=bitly&utm_source=Blog

IBM Bluemix devOps Services: https://www.youtube.com/user/JazzHub

Getting Started With Bluemix: http://www.ibm.com/developerworks/cloud/courses/getting-started-with-bluemix/index.html

Fóruns/Community/Tutoriais

IBM Developer Works: http://www.ibm.com/developerworks/topics/bluemix

Stack Overflow : http://stackoverflow.com/search?q=bluemix

Links Adicionais

The Twelve-Factor App - methodology for building software-as-a-service apps: http://12factor.net/

Demonstrações do Watson: https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/gallery.html

Open4Education: Minicurso Gratuito: PaaS na Prática com IBM Bluemix: https://www.youtube.com/watch?v=rVyWUHkfX-M