Month: May 2018

  • Blog
  • Month: May 2018

Getting started with Machine Learning – Node.js integrated with Google Video-Intelligence

Machine Learning is an idea to learn from examples and experience, without being explicitly programmed. Instead of writing code, you feed data to the generic algorithm, and it builds logic based on the datasets given. In this article, we are going to cover a simple example of Machine Learning by integrating “Google Video-Intelligence” API with Node.js application. What is Google Video-Intelligence? Google under the project of Machine Learning has introduced Video-Intelligence. This makes video searchable and discoverable by extracting contents of a video with an easy to use REST API. furthermore, you can read more about google video intelligence on the google page. Prerequisites for Machine Learning Basic knowledge of Node.js applications Basic knowledge of Google Cloud Platform Step 1: Enable the Google Video-Intelligence API Sign into your google account with valid user credentials In the Google Cloud Platform Console, go to the Manage resources page and select or create a new project. Make sure that billing is enabled for your project. Also, you can find guidelines on the google docs link. Enable the Cloud Video Intelligence API. Step 2: Authenticating to a Cloud API Service To allow your application code to use a Cloud API, you will need to set up the proper credentials for your application to authenticate its identity to the service and to obtain authorization to perform tasks. The simplest authentication scheme is that of an API key. However, an API key does not allow you to authorize to the service, so it is only usable on public data or data you pass directly to the RPC API. Set up an API key After you enable a Cloud API, Go to “API & Services” through navigation menu. Click “Go to Credentials” to click on the Create Credentials button. Select “API key” from the options. You may wish to copy your key and keep it secure (you can also retrieve it from the API Manager→Credentials page). Set up a service account for machine learning Google Cloud Platform API authentication and authorization (commonly grouped together as “auth”) is typically done using a service account. in addition, A service account allows your code to send application credentials directly to the Cloud API. Go to “API & Services” through navigation menu. Click on “Create Credentials” and select “Service account key”. Select service account as “Compute engine default service account”, select key type as JSON and hit the Create button. Finally, GCP Console will generate a JSON key (as a .json text file), prompt you to download the file to your computer. The generated JSON key will be similar to the following sample JSON key: { “type”: “service_account”, “project_id”: “project-id”, “private_key_id”: “some_number”, “private_key”: “—–BEGIN PRIVATE KEY—–\n…. =\n—–END PRIVATE KEY—–\n”, “client_email”: “<api-name>api@project-id.iam.gserviceaccount.com”, “client_id”: “…”, “auth_uri”: “https://accounts.google.com/o/oauth2/auth”, “token_uri”: “https://accounts.google.com/o/oauth2/token”, “auth_provider_x509_cert_url”: “https://www.googleapis.com/oauth2/v1/certs”, “client_x509_cert_url”: “https://www.googleapis.com/…<api-name>api%40project-id.iam.gserviceaccount.com” } Install and initialize the Cloud SDK Download appropriate google cloud SDK to your OS platform. The installer starts a terminal window and runs the gcloud init command in windows (for other operating systems, manually run the same command). Go through the online guide for detailed information. Provide authentication credentials to your application code by running the following command. Replace [PATH] with the location of the JSON file that contains your credentials. gcloud auth activate-service-account –key-file=[PATH] Obtain an authorization token using the command: gcloud auth print-access-token Copy the access token at somewhere safe. Step 3: Integration with Node.js Application Considering you have already a basic Node.js application ready, we will explain how to use google REST APIs. In order to use video-intelligence, we need to install npm package containing client library. Open the command prompt in the project directory and install google cloud library using the following command npm install –save @google-cloud/video-intelligence Once the package is installed, we will write a code providing local storage video URL to the function. This function will convert the video into the base64 format and pass to the google video intelligence API. Code for Implementation // Imports the Google Cloud Video Intelligence library + Node’s fs library const video = require(‘@google-cloud/video-intelligence’).v1; const fs = require(‘fs’); // Creates a client const client = new video.VideoIntelligenceServiceClient(); /** * TODO(developer): Uncomment the following line before running the sample. */ // const path = ‘Local file to analyze, e.g. ./my-file.mp4’; const path = ‘avengers_trailer.mp4’; // Reads a local video file and converts it to base64 const file = fs.readFileSync(path); const inputContent = file.toString(‘base64’); // Constructs request const request = { inputContent: inputContent, features: [‘LABEL_DETECTION’], }; // Detects labels in a video client .annotateVideo(request) .then(results => { const operation = results[0]; console.log(‘Waiting for operation to complete…’); return operation.promise(); }) .then(results => { // Gets annotations for video const annotations = results[0].annotationResults[0]; const labels = annotations.segmentLabelAnnotations; labels.forEach(label => { console.log(`Label ${label.entity.description} occurs at:`); label.segments.forEach(segment => { let time = segment.segment; if (time.startTimeOffset.seconds === undefined) { time.startTimeOffset.seconds = 0; } if (time.startTimeOffset.nanos === undefined) { time.startTimeOffset.nanos = 0; } if (time.endTimeOffset.seconds === undefined) { time.endTimeOffset.seconds = 0; } if (time.endTimeOffset.nanos === undefined) { time.endTimeOffset.nanos = 0; } console.log( `\tStart: ${time.startTimeOffset.seconds}` + `.${(time.startTimeOffset.nanos / 1e6).toFixed(0)}s` ); console.log( `\tEnd: ${time.endTimeOffset.seconds}.` + `${(time.endTimeOffset.nanos / 1e6).toFixed(0)}s` ); console.log(`\tConfidence: ${segment.confidence}`); }); }); callback(labels); }) .catch(err => { console.error(‘ERROR:’, err); }); After giving the request some time (about a minute, typically), the same request returns annotation results in JSON format. Congratulations! You’ve sent your first request to Cloud Video Intelligence API. Note:- Google Video-Intelligence API is not a free service. You can get free credits for demo purpose. You want any assitance or want to develop you application in Machine Learning you can always contact us here. Resource- Google Video-Intelligence Docs

How to List Coin on Exchange and Crypto Exchanges

How to List Coin on Exchange and Crypto Exchanges Many Individuals , Teams and Organization are launching crypto coins with Block Chain Technology. The success stories of Sia Coin , Electronium , Ethereum is motivating many to launch their coin on Crypto Coins. Block Chain technology is must for launching coin and the credibility of Block Chain technology helps coin owners to make it acceptable to few in their circles. But the credibility of coins becomes global when its available for exchange on any of the crypto exchange. This is most difficult task where people are stuck in. Whats Required to List Coin on Exchange and Crypto Exchanges Listing on Exchange is not an easy task. Your coins have to pass on some small and very few critical criteria to be eligible for crypto exchange listing. Like some wants coin to be at-least one year old ,some don’t want coin to be pre-mine more than 10%  , some wants good records of ICO , some want good community support. Apart from criteria the  next constraints is fees.Some exchange charge very heavy fees for listing. Some exchange have voting system but that also require heavy investment for paid voting since paid voting is given more importance than free voting. How to Proceed to List Coin on Exchange and Crypto Exchanges First prepare a good draft of you coin information with atleast below details. Please ensure you are writing Aim and Coin base. Dear Sir, Please find the details of our coin , and please tell us the process to list our coin in your exchange. Aim : Aim of our coin Bitcoin was to replace the fiat currency which digital currency. The algorithm is design to safeguard the interest of individual involve in the transaction. Bitcoin is the public ledger ,in future its expected that it will reduce the usage of paper and will also reduce the corruption to high extent. 1. Name : Bitcoin 2. Ticker : BTC 3. Algo : SHA-256 4. Money Supply : 21,000,000 5. Minimum Commission : 0.001 5. Source : https://github.com/bitcoin 6. Founder Insta Mine : 0% 7. Coin Website : N/A 8. Bitcoin Talk : https://bitcointalk.org 9. Coin Logo : Find Attachment 10. Explorer: https://blockchain.info/ 11. User base: Million+ Users. Thanks & Regards Bitcoin Team (Never write your or your company name over here. Block Chain is all about team and decentrailization) Aim and User Base plays an important role. With good user base you can expect a good response from exchange. Please make sure you are not giving wrong values they will some how figure out with your explorer. Identify the Exchanges and Post them an email This is important task. Since if you go for very good exchange it may take an year to list the coin or finally they may not list our coin citing any reason. This will waster your lot of time. Other major problem with exchanges is that they may charge you very hectic fees that could have been used to bring users to your coin with good purchase often called as Pumping. To ease out your work Techaroha Team have identified few exchanges. 1. poloniex   https://poloniex.com/ If your coin is More than 1 Year Old and its have a very good avtive commuity then this is the best exchange for you. Its 100% free , they will list your coin only when they think its importnat and has good follower. Other way round is you must have good connect with management team , this can ease your work. Actually this last lineis true of any organization. 2. HitBTC   https://hitbtc.com It’s gaining lot of populairty with so many coin listed in the exchange. But its very very coslty they may charge you upto 10 BTC to list the coin in their exchange. If you have big pocket and want to be sure that your coin will work and willing to invest this exchange is for you. 3. Coinbase  https://www.coinbase.com/ You have good community and if you coin is listed in Gdax then this exchange is best for you. It will be an easy entry if your coin is listed on Gdax. 4. Bitridex https://bitridex.com/ If you don’t want to much invest in listing and want regular buys of your coin then this is the best exchange. They charge nominal fee for exchange listing. If have different offers to suit your need. Checkout in website or drop them a mail you can expect a response in max 3-4 Hours 5. Mercatox https://mercatox.com/ Mercatox is gaining popularity among small coins, if you can arrange for the voting specially paid voting or voting from active members you will have very high probability to list this coin one exchange. Techaroha team a Block Chain development company based in Mumbai(India) has experience block chain development team and can help you in all phases of coin development and then listing it on the exchange. Please contact us here if you want any assistance. To get the details of our service please go through the following link To Launch Cryptocurrency will please click here. You want help with ICO please click here.

How to Launch a CryptoCurrency

With the success of Bitcoin and many other concurrency like often termed as Alt-coin, many small to big organization and even individual have launched cryptourrency or they are planning to launch cryptocurrency. Launching cryptocurrency involves several steps and its life cycle is complicated compared to normal software.More important is the post launch planning , how to take it to masses and how to ensure the integrity of block-chain and disallow the control of mining power into the hands of individual and or any organization.’ How to Launch a CryptoCurrency Step 1 To launch a cryptocurrency first that needs to be answered his what purpose will it serve and what existing process will be replace by it. What centralized application or system will be decentralized by the cryptocurrency. Lets consider an example , who want to decentralized something like News Channel. Now a days few big channels and websites have the control the news that need to be circulated. Now you want to decentralized this things.  You can launch the new coin which will decentralized the news being circulated and it will give control to the community instead of    few big players. In short its a application where any individual can publish the news with a coin and community will approve the same and will gain the coin. Lot of detailing is involve over here to reduce the money power and give it a credibility , if you are interested you can contact us here. Step 2: Finalize the distribution of Rewards and others important technical aspects. Block-chain is distributed and decentralized and public ledger. This definition requires you to design your coin in such a way the community is attracted to it and it’s secure , so that it can be made public. Block-chain is highly encrypted public ledger , for encryption coins needs algorithim. There are various algo available like SHA256 , sCRYPT, X11,X16 ,CRYPTOIGHT etc. Depending upon the need you can choose the best algorithm. Next big thing to decide is the block rewards and block reward time. This too factor plays very important role when you launch the cryptocurrency. Block Reward time will decide how early transactions will be confirmed , putting this value too small will increase the difficulty eventually cost of block generation will be very high and putting it too high will slow down the confirmation. A mid level good choice is required. The other aspects Block Reward is required so that community will support the network for your coin.Too much off block reward will reduce the value to zero often termed as dumping of coins , to high value will increase the difficulty again a mid level block reward value is required to launch the cryptocurency. Step 3 This is the most difficult and most important task to launch and ICO and collect some funds.  Effective marketing team is required to launch an ICO , which will ensure that message is spread to the community and all are interested to invest and take the coin forward. ICO funds are very important to ensure that future development happens and coin is well supported and listed on exchange. Techaroha team a Block Chain development company based in Mumbai(India) has experience block chain development team and can help you in all phases of coin development for Coin Development to Listing. To get the details of our service please go through the following link To Launch Cryptocurrency will please click here. You want help with ICO please click here.