Try to search your question here, if you can't find : Ask Any Question Now ?

How Can I Display My Console.Log Items on Webpage

HomeCategory: stackoverflowHow Can I Display My Console.Log Items on Webpage
Avatarkundan asked 1 month ago

I am Trying to Create a React App That Detects Age of Pictures Using Clarifai API .
I am Able to Console.Log An Array of Detected Ages but I Want To Display The Age with Most Probability on My Webpage .
You can Goto https://cyumair.github.io/smartbrain/ and You can see an Array of 20 Elements When You Paste Image Link and Click Detect .
Code Src:https://github.com/cyumair/smartbrain/blob/master/src/App.js

             //Array Displayed On Console
              // Array[20][
               0: Object { id: "ai_XCS0ZXlc",
                           name: "39",
                           value: 0.50979275, … }
                   //.....]
               //I Want To Display The Name That Has Highest Value 

            //App.js Code That Console.Logs Array of Age
              console.log(response.outputs[0].
                   data.regions[0].data.face.age_appearance.concepts);                           
            //More App.js Code
          class App extends Component {
            constructor(){
            super();
            this.state = {
            input : '',
            imgURL : ''
             }
          }
      onInputChange = (event) => {
      this.setState({input : event.target.value});
       }

      onClickEvent = () => {
            this.setState({imgURL : this.state.input})
            app.models.predict(Clarifai.DEMOGRAPHICS_MODEL,
                                this.state.input).then(
                 function(response) {
                           console.log(                                                            
                             response.outputs[0].data.
                                          regions[0].
                                   data.face.age_appearance.concepts);

             },
1 Answers
Best Answer
AvatarArben answered 1 month ago
Your Answer

17 + 7 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com