<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by BHUBESH KRA on Medium]]></title>
        <description><![CDATA[Stories by BHUBESH KRA on Medium]]></description>
        <link>https://medium.com/@krboobesh?source=rss-6943e6743aa7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*IDYWnoDFD5u6cus_.</url>
            <title>Stories by BHUBESH KRA on Medium</title>
            <link>https://medium.com/@krboobesh?source=rss-6943e6743aa7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:48:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krboobesh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Emotion Detection from Facial Expressions using Deep Learning]]></title>
            <link>https://medium.com/@krboobesh/emotion-detection-from-facial-expressions-using-deep-learning-e89d9de79f54?source=rss-6943e6743aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e89d9de79f54</guid>
            <dc:creator><![CDATA[BHUBESH KRA]]></dc:creator>
            <pubDate>Mon, 04 May 2020 14:22:10 GMT</pubDate>
            <atom:updated>2020-05-04T14:22:10.148Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Need For Emotion Detection</strong></h3><p>The need for Facial Expression Recognition, a part of facial recognition, is gaining more importance now-a-days and increasing tremendously. Though there are methods to identify expressions using Machine Learning and Artificial Intelligence techniques, this work attempts to use Deep Learning method to recognize facial expressions. The proposed method classifies the emotions according to the trained facial expressions from the dataset considered. The research work uses Convolution Neural Network (CNN) techniques to detect emotions from face while a person speaks in the video. Multi-modal Emotion Recognition has been used which is relatively a new discipline. It aims to include text inputs, as well as sound and video for detecting emotions recognition. It gives 80% accuracy of facial emotion detection from real time speaking videos.</p><h3><strong>Introduction</strong></h3><p>The market research report [1] says that the global emotion detection and recognition market size would grow to 56 USD by 2024. Facial Emotion recognition is one of the hottest areas where companies around the world consider the mountain of investment. This product may provide API service for many businesses to understand and recognize the user emotions. It may also be extended to include voice recognition along with facial emotion recognition. The main objective of these types of applications is to capture the market with high accuracy in this global competition service e.</p><p>Expressions or emotions are the most important factor in any inter-personal communication. They may take different forms which may be missed from human eyes. Recognizing facial emotions are the need of the hour in the context of human-human communication. It helps in understanding the intentions of others. Generally, people use facial expressions like happy, anger and sadness and voice to understand the emotional states. Verbal components constitute one-third of human communication and nonverbal components constitute remaining two-thirds. Among 2/3, facial expressions is the main channel in interpersonal communication. With the help of advanced tools and technologies, they may be subject to detection and recognition. Emotion recognition can be performed using different features, such as face, speech, EEG and text. Among these, the efficient feature could be facial expressions, as they are visible and more information may be extracted from them [6].</p><p>More research focus is given towards this emerging area by applying deep learning and artificial intelligence techniques. Facial emotion detection has unique set of use cases in different domains like marketing, education, social security and so on. Emotions play a vital role in retail sectors and it drives the public in purchasing products [2]. The studies by the neuroscientist Antonio Damasio concluded that people would have low decision making skills if they were unable to feel their emotions [4]. Bringing in dynamism in marketing provides right message to the right persons at right time. With the help of digital experience, the marketing for business can be calibrated [3].</p><p>The article [7] says that a FaceApp created by a software company has been used in detecting the criminals and terrorists. The app supported the police by identifying the people who are more emotional, nervous and stressful in the crowd. By doing this continuous surveillance in suspected areas, the crimes can also be stopped before it happens.</p><p>In education field, these FER products may find its relevance during the conduct of examinations. Invigilators can monitor the candidates from the remote location. Using the facial expressions and body movements, the coordination between the affective and cognitive domain of learners can be analyzed and emotional personalized support may be provided to the learners, if needed [8].</p><p>Customer satisfaction is the biggest marketing strategy for any type of business. Sentiment analysis-based solution supports this problem but mostly the customer feedback is in the form of textual responses. Also, it helps the business to change its strategy after sometime, not in the real time. However, the facial emotion recognition is real time and it brings business intelligence immediately. One of the Caribbean cruise companies used this technology and analyzed its on-board customers’ satisfaction [9].</p><p>Supermarket may use this technology along with data mining algorithms to improve their targeted marketing and product placement based on their age and mood. Human Resources (HR) managers may use this FER technology in their selection process of candidates [10].</p><p>FER can be applied to various applications. However, it has some limitations. Though various sensors such as an electromyograph (EMG), electrocardiogram (ECG), electroencephalograph (EEG), and camera are used for receiving FER inputs, camera is the most reliable type of sensor. Camera provides most of the facial information and would not wear out earlier [5]. Micro-movements of faces need to be captured using high resolution images. Highly intensive algorithms with large computing power are required for further analysis.</p><h3><strong>Literature Survey</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*kFzI6M-Ia5ykK4JsVLaKEQ.png" /><figcaption>Figure 0.Literature Survey Table</figcaption></figure><h3><strong>Methodology</strong></h3><p>Facial Emotion Recognition (FER) is an important topic in the fields of computer vision and artificial intelligence owing to its significant academic and commercial potential. Although FER can be conducted using multiple sensors, this article focuses on studies that exclusively use facial images. The objective of this research work is to develop an application for classifying emotions using videos, audio and text. The overall architecture of this application is shown in Figure 1. CNN is used with deep architectures to detect face from video and to detect emotions. LSTM is used in audio and text documents for emotion classification. Pre-trained models and transfer learning are applied to train the facial recognition model. Convolution Neural Network (CNN), Deep Belief Network (DBN) and Generative Adversarial Network (GAN) based architecture is used to train the videos with Adam optimizer. Three different datasets like face, audio, and text are used for detection of emotions. The website is developed and the training model is deployed into it so as to make it available for end users for ‘live detection’ of emotions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*ZHE-T_oKUFcPNXWs1i8AeQ.png" /><figcaption>Figure 1.Architecture Diagram for Emotional Detection</figcaption></figure><h3>Dataset Description</h3><p>We use facial landmark expressions data in OpenCV to detect the faces while testing the live video. Facial landmarks dataset have the face map features to identify eyes, nose, mouth, and so on. The dataset has more than 1000 videos with 7 different labels for representing emotions of the user. The size of dataset is 3 GB.</p><h3>1. Face Emotion Detection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*J96KKDjGVZAi8cO1leOTZw.png" /><figcaption>Figure 2. Emotion Detection from Facial Expressions</figcaption></figure><p>CNN architecture consisting of 1–4 convolution layers is used for emotion detection from faces. The face of the speaker is extracted from the video data and trained. Data is fed into the Convolution layer, and into the classifier part which contains max-pooling and dense layer architectures. Trained CNN model is saved and used for testing.</p><p>The training process begins from face extraction from the video dataset. The face from the video is extracted as image and then the image is trained in the above architecture. For each emotion over 500 plus images are trained and the model is saved. The trained model is able to capture emotions of more than one faces from a single video instance.</p><h4><strong><em>Sample Code:</em></strong></h4><blockquote>def show_webcam() :</blockquote><blockquote>shape_x = 48</blockquote><blockquote>shape_y = 48</blockquote><blockquote>input_shape = (shape_x, shape_y, 1)</blockquote><blockquote>nClasses = 7</blockquote><blockquote>thresh = 0.25</blockquote><blockquote>frame_check = 20</blockquote><blockquote>def eye_aspect_ratio(eye):</blockquote><blockquote>A = distance.euclidean(eye[1], eye[5])</blockquote><blockquote>B = distance.euclidean(eye[2], eye[4])</blockquote><blockquote>C = distance.euclidean(eye[0], eye[3])</blockquote><blockquote>ear = (A + B) / (2.0 * C)</blockquote><blockquote>return ear</blockquote><blockquote>def detect_face(frame):</blockquote><blockquote>#Cascade classifier pre-trained model</blockquote><blockquote>cascPath = ‘Models/face_landmarks.dat’</blockquote><blockquote>faceCascade = cv2.CascadeClassifier(cascPath)</blockquote><blockquote>gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)</blockquote><blockquote>detected_faces = faceCascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=6,</blockquote><blockquote>minSize=(shape_x, shape_y),</blockquote><blockquote>flags = cv2.CASCADE_SCALE_IMAGE)</blockquote><blockquote>coord = []</blockquote><blockquote>for x, y, w, h in detected_faces:</blockquote><blockquote>if w &gt; 100 :</blockquote><blockquote>sub_img=frame[y:y+h,x:x+w]</blockquote><blockquote>cv2.rectangle(frame,(x,y),(x+w,y+h),(0, 255,255),1)</blockquote><blockquote>coord.append([x,y,w,h])</blockquote><blockquote>return gray, detected_faces, coord</blockquote><blockquote>def extract_face_features(faces, offset_coefficients=(0.075, 0.05)):</blockquote><blockquote>gray = faces[0]</blockquote><blockquote>detected_face = faces[1]</blockquote><blockquote>new_face = []</blockquote><blockquote>for det in detected_face :</blockquote><blockquote>x, y, w, h = det</blockquote><blockquote>#Offset coefficient, np.floor takes the lowest integer (delete border of the image)</blockquote><blockquote>horizontal_offset = np.int(np.floor(offset_coefficients[0] * w))</blockquote><blockquote>vertical_offset = np.int(np.floor(offset_coefficients[1] * h))</blockquote><blockquote>#gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)</blockquote><blockquote>#gray transforme l’image</blockquote><blockquote>extracted_face = gray[y+vertical_offset:y+h, x+horizontal_offset:x-horizontal_offset+w]</blockquote><blockquote>#Zoom sur la face extraite</blockquote><blockquote>new_extracted_face = zoom(extracted_face, (shape_x / extracted_face.shape[0],</blockquote><blockquote>shape_y / extracted_face.shape[1]))</blockquote><blockquote>#cast type float</blockquote><blockquote>new_extracted_face = new_extracted_face.astype(np.float32)</blockquote><blockquote>#scale</blockquote><blockquote>new_extracted_face /= float(new_extracted_face.max())</blockquote><blockquote>#print(new_extracted_face)</blockquote><blockquote>new_face.append(new_extracted_face)</blockquote><blockquote>return new_face</blockquote><blockquote>model = load_model(‘Models/video.h5’)</blockquote><blockquote>face_detect = dlib.get_frontal_face_detector()</blockquote><blockquote>predictor_landmarks = dlib.shape_predictor(“Models/face_landmarks.dat”)</blockquote><blockquote>video_capture = cv2.VideoCapture(0)</blockquote><blockquote>while True:</blockquote><blockquote># Capture frame-by-frame</blockquote><blockquote>ret, frame = video_capture.read()</blockquote><blockquote>face_index = 0</blockquote><blockquote>gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)</blockquote><blockquote>rects = face_detect(gray, 1)</blockquote><blockquote>#gray, detected_faces, coord = detect_face(frame)</blockquote><blockquote>for (i, rect) in enumerate(rects):</blockquote><blockquote>shape = predictor_landmarks(gray, rect)</blockquote><blockquote>shape = face_utils.shape_to_np(shape)</blockquote><blockquote>(x, y, w, h) = face_utils.rect_to_bb(rect)</blockquote><blockquote>face = gray[y:y+h,x:x+w]</blockquote><blockquote>#Zoom on extracted face</blockquote><blockquote>face = zoom(face, (shape_x / face.shape[0],shape_y / face.shape[1]))</blockquote><blockquote>#Cast type float</blockquote><blockquote>face = face.astype(np.float32)</blockquote><blockquote>#Scale</blockquote><blockquote>face /= float(face.max())</blockquote><blockquote>face = np.reshape(face.flatten(), (1, 48, 48, 1))</blockquote><blockquote>#Make Prediction</blockquote><blockquote>prediction = model.predict(face)</blockquote><blockquote>prediction_result = np.argmax(prediction)</blockquote><blockquote># Rectangle around the face</blockquote><blockquote>cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)</blockquote><blockquote>cv2.putText(frame, “Face #{}”.format(i + 1), (x — 10, y — 10),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)</blockquote><blockquote>for (j, k) in shape:</blockquote><blockquote>cv2.circle(frame, (j, k), 1, (0, 0, 255), -1)</blockquote><blockquote># 1. Add prediction probabilities</blockquote><blockquote>cv2.putText(frame, “ — — — “,(40,100 + 180*i), cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 0)</blockquote><blockquote>cv2.putText(frame, “Emotional report : Face #” + str(i+1),(40,120 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 0)</blockquote><blockquote>cv2.putText(frame, “Angry : “ + str(round(prediction[0][0],3)),(40,140 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 0)</blockquote><blockquote>cv2.putText(frame, “Disgust : “ + str(round(prediction[0][1],3)),(40,160 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 0)</blockquote><blockquote>cv2.putText(frame, “Fear : “ + str(round(prediction[0][2],3)),(40,180 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote>cv2.putText(frame, “Happy : “ + str(round(prediction[0][3],3)),(40,200 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote>cv2.putText(frame, “Sad : “ + str(round(prediction[0][4],3)),(40,220 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote>cv2.putText(frame, “Surprise : “ + str(round(prediction[0][5],3)),(40,240 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote>cv2.putText(frame, “Neutral : “ + str(round(prediction[0][6],3)),(40,260 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote># 2 Annotate main image with a label</blockquote><blockquote>if prediction_result == 0 :</blockquote><blockquote>cv2.putText(frame, “Angry”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 1 :</blockquote><blockquote>cv2.putText(frame, “Disgust”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 2 :</blockquote><blockquote>cv2.putText(frame, “Fear”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 3 :</blockquote><blockquote>cv2.putText(frame, “Happy”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 4 :</blockquote><blockquote>cv2.putText(frame, “Sad”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 5 :</blockquote><blockquote>cv2.putText(frame, “Surprise”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>else :</blockquote><blockquote>cv2.putText(frame, “Neutral”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote># 3 Eye Detection and Blink Count</blockquote><blockquote>leftEye = shape[lStart:lEnd]</blockquote><blockquote>rightEye = shape[rStart:rEnd]</blockquote><blockquote># Compute Eye Aspect Ratio</blockquote><blockquote>leftEAR = eye_aspect_ratio(leftEye)</blockquote><blockquote>rightEAR = eye_aspect_ratio(rightEye)</blockquote><blockquote>ear = (leftEAR + rightEAR) / 2.0</blockquote><blockquote># And plot its contours</blockquote><blockquote>leftEyeHull = cv2.convexHull(leftEye)</blockquote><blockquote>rightEyeHull = cv2.convexHull(rightEye)</blockquote><blockquote>cv2.drawContours(frame, [leftEyeHull], -1, (0, 255, 0), 1)</blockquote><blockquote>cv2.drawContours(frame, [rightEyeHull], -1, (0, 255, 0), 1)</blockquote><blockquote># 4. Detect Nose</blockquote><blockquote>nose = shape[nStart:nEnd]</blockquote><blockquote>noseHull = cv2.convexHull(nose)</blockquote><blockquote>cv2.drawContours(frame, [noseHull], -1, (0, 255, 0), 1)</blockquote><blockquote># 5. Detect Mouth</blockquote><blockquote>mouth = shape[mStart:mEnd]</blockquote><blockquote>mouthHull = cv2.convexHull(mouth)</blockquote><blockquote>cv2.drawContours(frame, [mouthHull], -1, (0, 255, 0), 1)</blockquote><p>First all the necessary libraries are imported and the face landmarks dataset is loaded. After detecting the face, it is mapped inside the rectangle box. Then each of the facial landmarks is mapped in the given face with numpy arrays.</p><p>Video capture function has been called from OpenCV library. Using predictor landmarks, the face in the real time video has been identified. The identified face landmarks are bounded in rectangle box. The face bounded by rectangle box is sent for prediction with the pre-trained model. The model predicts the emotions from the face. Also it sends the emotional report of probabilities which gives statistics like how many faces are detected and percentage of each emotion in the given face.</p><blockquote>cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)</blockquote><blockquote>cv2.putText(frame, “Face #{}”.format(i + 1), (x — 10, y — 10), cv2.FONT_HERSHEY_SIMPLEX,</blockquote><blockquote>0.5, (0, 255, 0), 2)</blockquote><blockquote>for (j, k) in shape:</blockquote><blockquote>cv2.circle(frame, (j, k), 1, (0, 0, 255), -1)</blockquote><blockquote># 1. Add prediction probabilities</blockquote><blockquote>cv2.putText(frame, “ — — — — — — -”,(40,100 + 180*i), cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 0)</blockquote><blockquote>cv2.putText(frame, “Emotional report : Face #” + str(i+1),(40,120 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 0)</blockquote><blockquote>cv2.putText(frame, “Angry : “ + str(round(prediction[0][0],3)),(40,140 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 0)</blockquote><blockquote>cv2.putText(frame, “Disgust : “ + str(round(prediction[0][1],3)),(40,160 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 0)</blockquote><blockquote>cv2.putText(frame, “Fear : “ + str(round(prediction[0][2],3)),(40,180 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote>cv2.putText(frame, “Happy : “ + str(round(prediction[0][3],3)),(40,200 + 180*i), cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote>cv2.putText(frame, “Sad : “ + str(round(prediction[0][4],3)),(40,220 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote>cv2.putText(frame, “Surprise : “ + str(round(prediction[0][5],3)),(40,240 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote>cv2.putText(frame, “Neutral : “ + str(round(prediction[0][6],3)),(40,260 + 180*i),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 0.5, 155, 1)</blockquote><blockquote># 2. Annotate main image with a label</blockquote><blockquote>if prediction_result == 0 :</blockquote><blockquote>cv2.putText(frame, “Angry”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 1 :</blockquote><blockquote>cv2.putText(frame, “Disgust”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 2 :</blockquote><blockquote>cv2.putText(frame, “Fear”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 3 :</blockquote><blockquote>cv2.putText(frame, “Happy”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 4 :</blockquote><blockquote>cv2.putText(frame, “Sad”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>elif prediction_result == 5 :</blockquote><blockquote>cv2.putText(frame, “Surprise”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote>else :</blockquote><blockquote>cv2.putText(frame, “Neutral”,(x+w-10,y-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)</blockquote><blockquote># 3. Eye Detection and Blink Count</blockquote><blockquote>leftEye = shape[lStart:lEnd]</blockquote><blockquote>rightEye = shape[rStart:rEnd]</blockquote><blockquote># Compute Eye Aspect Ratio</blockquote><blockquote>leftEAR = eye_aspect_ratio(leftEye)</blockquote><blockquote>rightEAR = eye_aspect_ratio(rightEye)</blockquote><blockquote>ear = (leftEAR + rightEAR) / 2.0</blockquote><blockquote># And plot its contours</blockquote><blockquote>leftEyeHull = cv2.convexHull(leftEye)</blockquote><blockquote>rightEyeHull = cv2.convexHull(rightEye)</blockquote><blockquote>cv2.drawContours(frame, [leftEyeHull], -1, (0, 255, 0), 1)</blockquote><blockquote>cv2.drawContours(frame, [rightEyeHull], -1, (0, 255, 0), 1)</blockquote><blockquote># 4. Detect Nose</blockquote><blockquote>nose = shape[nStart:nEnd]</blockquote><blockquote>noseHull = cv2.convexHull(nose)</blockquote><blockquote>cv2.drawContours(frame, [noseHull], -1, (0, 255, 0), 1)</blockquote><blockquote># 5. Detect Mouth</blockquote><blockquote>mouth = shape[mStart:mEnd]</blockquote><blockquote>mouthHull = cv2.convexHull(mouth)</blockquote><blockquote>cv2.drawContours(frame, [mouthHull], -1, (0, 255, 0), 1)</blockquote><blockquote># 6. Detect Jaw</blockquote><blockquote>jaw = shape[jStart:jEnd]</blockquote><blockquote>jawHull = cv2.convexHull(jaw)</blockquote><blockquote>cv2.drawContours(frame, [jawHull], -1, (0, 255, 0), 1)</blockquote><blockquote># 7. Detect Eyebrows</blockquote><blockquote>ebr = shape[ebrStart:ebrEnd]</blockquote><blockquote>ebrHull = cv2.convexHull(ebr)</blockquote><blockquote>cv2.drawContours(frame, [ebrHull], -1, (0, 255, 0), 1)</blockquote><blockquote>ebl = shape[eblStart:eblEnd]</blockquote><blockquote>eblHull = cv2.convexHull(ebl)</blockquote><blockquote>cv2.drawContours(frame, [eblHull], -1, (0, 255, 0), 1)</blockquote><blockquote>cv2.putText(frame,’Number of Faces : ‘ + str(len(rects)),(40, 40),</blockquote><blockquote>cv2.FONT_HERSHEY_SIMPLEX, 1, 155, 1)</blockquote><blockquote>cv2.imshow(‘Video’, frame)</blockquote><blockquote>if cv2.waitKey(1) &amp; 0xFF == ord(‘q’):</blockquote><blockquote>break</blockquote><blockquote># When everything is done, release the capture</blockquote><blockquote>video_capture.release()</blockquote><blockquote>cv2.destroyAllWindows()</blockquote><blockquote>def main():</blockquote><blockquote>show_webcam()</blockquote><blockquote>if __name__ == “__main__”:</blockquote><blockquote>main()</blockquote><h4>Results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*RAzJb_D4Alqd-nyHFsuQwg.png" /><figcaption>Figure 3 Emotion Detection in the intermittent Stage</figcaption></figure><p>Figure 3 shows the intermediate result of finding emotion and printing their probabilities along with them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yaamaeNN-qjdyGoHc0b0Og.png" /><figcaption>Figure 4 Emotion Detection ‘Happy’ Face</figcaption></figure><blockquote>cv2.putText(frame,’Number of Faces : ‘ + str(len(rects)),(40, 40), cv2.FONT_HERSHEY_SIMPLEX,</blockquote><blockquote>1, 155, 1)</blockquote><blockquote>cv2.imshow(‘Video’, frame)</blockquote><blockquote>if cv2.waitKey(1) &amp; 0xFF == ord(‘q’):</blockquote><blockquote>break</blockquote><blockquote># When everything is done, release the capture</blockquote><blockquote>video_capture.release()</blockquote><blockquote>cv2.destroyAllWindows()</blockquote><blockquote>def main():</blockquote><blockquote>show_webcam()</blockquote><blockquote>if __name__ == “__main__”:</blockquote><blockquote>main()</blockquote><p>Above code recognizes all the faces in the frame. The number of faces is counted and displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w1O9K8Puh6L5CurSq8r23Q.jpeg" /><figcaption>Figure 5 Emotion Recognition of more than One Faces</figcaption></figure><p>Here the 2 faces are detected and their emotions are also predicted. Here the facial landmarks predictor will identify for faces first and the bound them with the rectangles. Then the face map features identify the eyes, nose of each face in the videos. Finally the captured images are sent to the predicted model one by one at a time and the emotional report is returned for each faces.</p><h4><strong><em>Bringing the result in WebPage:</em></strong></h4><blockquote>&lt;div class=”row”&gt;</blockquote><blockquote>&lt;h2&gt;&lt;i&gt;Perceived emotions&lt;/i&gt;&lt;/h2&gt;</blockquote><blockquote>&lt;h3&gt;Facial Emotions&lt;/h3&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;p&gt;Your most frequent emotion is : &lt;/p&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;h4&gt; {{emo}}&lt;/h4&gt;</blockquote><blockquote>&lt;div class=”parent”&gt;</blockquote><blockquote>&lt;ul align=”left”&gt;</blockquote><blockquote>&lt;li&gt;Anger : {{prob[0]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Disgust : {{prob[1]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Fear : {{prob[2]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Happiness : {{prob[3]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Sadness : {{prob[4]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Surprise : {{prob[5]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Neutrality : {{prob[6]}}%&lt;/li&gt;</blockquote><blockquote>&lt;/ul&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;div class=”row”&gt;</blockquote><blockquote>&lt;h2&gt;&lt;i&gt;Other candidates&lt;/i&gt;&lt;/h2&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;div class=”column” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;div id=”hist_density”&gt;&lt;/div&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;p&gt;Other candidates most frequent emotion is : &lt;/p&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;h4&gt; {{emo_other}} &lt;/h4&gt;</blockquote><blockquote>&lt;div class=”parent”&gt;</blockquote><blockquote>&lt;ul align=”left”&gt;</blockquote><blockquote>&lt;li&gt;Angry : {{prob_other[0]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Disgust : {{prob_other[1]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Fear : {{prob_other[2]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Happy : {{prob_other[3]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Neutral : {{prob_other[4]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Sad : {{prob_other[5]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Surprise : {{prob_other[6]}}%&lt;/li&gt;</blockquote><blockquote>&lt;/ul&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><p>Here d3.js library is used for plotting graph and comparing other person emotions with current person emotion. Figures 6 and 7 show the results of facial expressions of given video data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bV27e2Ws_MEBpfdTXsQcA.png" /><figcaption>Figure 6 Graphical Representations of Perceived Emotions of Present User</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RFdPtmk2Rg5ftrgn88HE0A.png" /><figcaption>Figure 7 Graphical Representations of Perceived Emotions of Other users</figcaption></figure><h3>2 AUDIO EMOTION DETECTION</h3><p>In this module, audio clipping is trained with 1–5 convolution layers i.e. with Deep CNN architecture and with Long Short Term Memory (LSTM) for identifying the context and as well as the tone of the text spoken by user, as shown in Figure 8. Tone and text have been analyzed for identifying the emotions from audio with probabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*qw6uXtW7GQZxZojxyBZGTw.png" /><figcaption>Figure 8. Emotion Detection from Audio Clippings</figcaption></figure><p>The CNN architecture is used to train the audio and LSTM is used to extract text effectively from the audio to detect the content of the text. In other words, CNN is used to find tone of the user and LSTM is used find the emotion in content. CNN architecture with 1–5 convolution layers and 1–3 LSTM layers are used in this module with softmax nonlinearity on top of the network. Stochastic gradient descent with momentum and the batch size of 164 has been used for optimization. L2-regularization has been used for regularization of weights. RAVDESS speech dataset of actors is used for training the CNN model.</p><p>The LSTM architecture is used to determine the context of the tone from their words using Word2vec model. Final probabilities for emotion are derived based on the decision made from both CNN and LSTM models.</p><h4><strong><em>Code:</em></strong></h4><blockquote>p = pyaudio.PyAudio()</blockquote><blockquote>stream = p.open(format=pyaudio.paInt16,</blockquote><blockquote>channels=channels,</blockquote><blockquote>rate=sample_rate,</blockquote><blockquote>input=True,</blockquote><blockquote>frames_per_buffer=chunk)</blockquote><blockquote># Create an empty list to store audio recording</blockquote><blockquote>frames = []</blockquote><blockquote># Determine the timestamp of the start of the response interval</blockquote><blockquote>print(‘* Start Recording *’)</blockquote><blockquote>stream.start_stream()</blockquote><blockquote>start_time = time.time()</blockquote><blockquote>current_time = time.time()</blockquote><blockquote>print(‘* End Recording * ‘)</blockquote><blockquote># Export audio recording to wav format</blockquote><blockquote>wf = wave.open(filename, ‘w’)</blockquote><blockquote>wf.setnchannels(channels)</blockquote><blockquote>wf.setsampwidth(p.get_sample_size(pyaudio.paInt16))</blockquote><blockquote>wf.setframerate(sample_rate)</blockquote><blockquote>wf.writeframes(b’’.join(frames))</blockquote><blockquote>wf.close()</blockquote><blockquote>y = TimeDistributed(Flatten(), name=’Flat_MELSPECT’)(y)</blockquote><blockquote># LSTM layer</blockquote><blockquote>y = LSTM(256, return_sequences=False, dropout=0.2, name=’LSTM_1&#39;)(y)</blockquote><blockquote># Fully connected</blockquote><blockquote>y = Dense(7, activation=’softmax’, name=’FC’)(y)</blockquote><blockquote># Build final model</blockquote><blockquote>model = Model(inputs=input_y, outputs=y)</blockquote><blockquote>return model</blockquote><blockquote>X = mel_spect_ts.reshape(mel_spect_ts.shape[0], mel_spect_ts.shape[1],</blockquote><blockquote>mel_spect_ts.shape[2], mel_spect_ts.shape[3], 1)</blockquote><blockquote># Predict emotion</blockquote><blockquote>if predict_proba is True:</blockquote><blockquote>predict = self._model.predict(X)</blockquote><blockquote>else:</blockquote><blockquote>predict = np.argmax(self._model.predict(X), axis=1)</blockquote><blockquote>predict = [self._emotion.get(emotion) for emotion in predict]</blockquote><blockquote># Clear Keras session</blockquote><blockquote>K.clear_session()</blockquote><blockquote># Predict timestamp</blockquote><blockquote>timestamp = np.concatenate([[chunk_size], np.ones((len(predict) — 1)) *</blockquote><blockquote>chunk_step]).cumsum()</blockquote><blockquote>timestamp = np.round(timestamp / sample_rate)</blockquote><blockquote>return [predict, timestamp]</blockquote><p>With the help of Pyaudio library the audio is recorded and separated into frames. Then each frame is intended for removing noise from the recorded audio. Fourier transform techniques are applied to remove noise. Now, it is ready for prediction.</p><p>The model uses time distributed CNN model. All architectures are deployed with the help of keras using tensorflow backend. Then the model is trained with audio dataset. The model file is exported. The testing is carried out using the model built and the predictions are moved to the CSV file. Figure 9 shows the intermediate result when model is loaded. Figure 10 shows the web page for the user to record his/her views based on given topic. Figures 11 and 12 show the results for audio dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*tdqCXDbyHq3GU6BmY8HUlA.png" /><figcaption>Figure 9 Emotion Detection from Audio Dataset — Intermediate Result</figcaption></figure><h4><strong><em>Webpage Code for Recording Audio</em></strong></h4><blockquote>{% block body %}</blockquote><blockquote>&lt;! — Interview question →</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;blockquote&gt;</blockquote><blockquote>&lt;p class=”quotation”&gt;Tell us about the last time you showed leadership.&lt;/p&gt;</blockquote><blockquote>&lt;/blockquote&gt;</blockquote><blockquote>&lt;! — Audio recording button →</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;form action=”/audio_recording” method=”post”&gt;</blockquote><blockquote>&lt;input type=”submit” name=”audio_recording” value=”Start Recording”&gt;</blockquote><blockquote>&lt;/form&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7vw1MLY45tyuUnPwOUi2Rw.png" /><figcaption>Figure 10 Webpage for Recording Audio</figcaption></figure><h4><strong><em>Code for displaying graph</em></strong></h4><blockquote>&lt;h2&gt;&lt;i&gt;Perceived emotions&lt;/i&gt;&lt;/h2&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;div class=”column” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;div class=”legend1&quot;&gt;</blockquote><blockquote>&lt;div class=”legend1&quot;&gt; &lt;p class=”country-name”&gt;</blockquote><blockquote>&lt;span class=”key-dot you”&gt;&lt;/span&gt;You&lt;/p&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;div class=”legend1&quot;&gt; &lt;p class=”country-name”&gt;</blockquote><blockquote>&lt;span class=”key-dot others”&gt;&lt;/span&gt;Other candidates&lt;/p&gt; &lt;/div&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;div id=”audio_emotions_dist”&gt;&lt;/div&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;div class=”column” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;p&gt;Your most frequent emotion is : &lt;b&gt;{{emo}}&lt;/b&gt;&lt;/p&gt;</blockquote><blockquote>&lt;div class=”parent”&gt;</blockquote><blockquote>&lt;ul align=”left”&gt;</blockquote><blockquote>&lt;li&gt;Angry : {{prob[0]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Disgust : {{prob[1]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Fear : {{prob[2]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Happy : {{prob[3]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Neutral : {{prob[4]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Sad : {{prob[5]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Surprise : {{prob[6]}}%&lt;/li&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bV27e2Ws_MEBpfdTXsQcA.png" /><figcaption>Figure 11 Perceived Emotions — Test User</figcaption></figure><blockquote>&lt;div class=”row”&gt;</blockquote><blockquote>&lt;h2&gt;&lt;i&gt;Other candidates&lt;/i&gt;&lt;/h2&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;div class=”column” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;div id=”audio_emotions_dist_other”&gt;&lt;/div&gt; &lt;/div&gt;</blockquote><blockquote>&lt;div class=”column” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;p&gt;Other candidates most frequent emotion is : &lt;b&gt;{{emo_other}}&lt;/b&gt;&lt;/p&gt;</blockquote><blockquote>&lt;div class=”parent”&gt;</blockquote><blockquote>&lt;ul align=”left”&gt;</blockquote><blockquote>&lt;li&gt;Angry : {{prob_other[0]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Disgust : {{prob_other[1]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Fear : {{prob_other[2]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Happy : {{prob_other[3]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Neutral : {{prob_other[4]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Sad : {{prob_other[5]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Surprise : {{prob_other[6]}}%&lt;/li&gt;</blockquote><blockquote>&lt;/ul&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RFdPtmk2Rg5ftrgn88HE0A.png" /><figcaption>Figure 12 Perceived Emotions — Other Candidates</figcaption></figure><h3>3 Text Emotion Detection</h3><p>In this module, Word2vec model has been used for vectorizing the input. After vectorization, the input is given to CNN model for training phase. Then it is trained by LSTM memory cell for effective memorization of keywords and text for detecting emotions more accurately, as shown in Figure 13.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*IWhsOK_bODuqzaSUvO6M3g.png" /><figcaption>Figure 13 Emotion Detection from Text Data</figcaption></figure><p>CNN architecture and Self Recurrent Gate from LSTM are used for emotion detections from text documents. Google’s Word2vec model is loaded for performing <strong><em>word embeddings</em></strong> in English language. These text are passed as a sequence to the CNN layers. The embeddings matrix is passed to embedding layer; five different filter sizes are applied to each comment; and GlobalMaxPooling1D layers are applied to each layer. All the outputs are then concatenated. A Dropout layer is applied for output regularization. The regularized output is further given to 2 dense layers; its output is processed by activation function and displayed by the network.</p><p>After the training with CNN, the trained text is passed into the memory cell that is self recurrent unit which performs the same operation of forget Gate of LSTM. Here the network will “forget” what is not necessary. The new input and the last layer output will go through a sigmoid layer. This is where everything which will be “forgotten” becomes 0. This layer is multiplied by the last cell’s state. The training model is saved and testing is carried out for different comments from the user.</p><h4><strong>Code</strong></h4><blockquote># Prepare the embedding</blockquote><blockquote>train_embedding_weights, train_word_index, wv_dict = self.prepare_embedding(X)</blockquote><blockquote># Begin evaluation</blockquote><blockquote>if verbose: print(“Building for evaluation”)</blockquote><blockquote>indices = range(len(y))</blockquote><blockquote># Keras model definition</blockquote><blockquote>Input_words = Input(shape=(300,), name=’input1&#39;)</blockquote><blockquote>x = Embedding(len(train_word_index) + 1, self.embed_dim,</blockquote><blockquote>weights=[train_embedding_weights],</blockquote><blockquote>input_length=self.max_sentence_len, trainable=True)(Input_words)</blockquote><blockquote># classifier.add(Embedding(30000, 300,input_length = 350))</blockquote><blockquote>x = Conv1D(filters=self.conv_nfilters, kernel_size= self.conv_kernel_size, padding=’same’,</blockquote><blockquote>activation=’relu’)(x)</blockquote><blockquote>x = MaxPooling1D(pool_size=self.max_pool_size)(x)</blockquote><blockquote>x = SpatialDropout1D(self.dropout)(x)</blockquote><blockquote>x = BatchNormalization()(x)</blockquote><blockquote>x = Conv1D(filters=(self.conv_nfilters)*2, kernel_size= self.conv_kernel_size,</blockquote><blockquote>padding=’same’, activation=’relu’)(x)</blockquote><blockquote>x = MaxPooling1D(pool_size=self.max_pool_size)(x)</blockquote><blockquote>x = SpatialDropout1D(self.dropout)(x)</blockquote><blockquote>x = BatchNormalization()(x)</blockquote><blockquote>x = Conv1D(filters=(self.conv_nfilters)*3, kernel_size= self.conv_kernel_size,</blockquote><blockquote>padding=’same’, activation=’relu’)(x)</blockquote><blockquote>x = MaxPooling1D(pool_size=self.max_pool_size)(x)</blockquote><blockquote>x = SpatialDropout1D(self.dropout)(x)</blockquote><blockquote>x = BatchNormalization()(x)</blockquote><blockquote>x = LSTM(self.lstm_out, return_sequences=True, dropout=self.dropout_lstm,</blockquote><blockquote>recurrent_dropout=self.recurrent_dropout_lstm)(x)</blockquote><blockquote>x = LSTM(self.lstm_out, return_sequences=True, dropout=self.dropout_lstm,</blockquote><blockquote>recurrent_dropout=self.recurrent_dropout_lstm)(x)</blockquote><blockquote>x = LSTM(self.lstm_out, dropout=self.dropout_lstm,</blockquote><blockquote>recurrent_dropout=self.recurrent_dropout_lstm)(x)</blockquote><blockquote>x = Dense(128, activation=’softmax’)(x)</blockquote><blockquote>out = Dense(5, activation=’softmax’)(x)</blockquote><blockquote>classifier = Model(inputs=Input_words, outputs=[out])</blockquote><blockquote>classifier.compile(loss=’categorical_crossentropy’, optimizer=’adam’, metrics=[‘accuracy’])</blockquote><blockquote>print(classifier.summary())</blockquote><blockquote># Loading pretrained model for transfer learning</blockquote><blockquote>if pretrained_weights_path and pretrained_model_path:</blockquote><blockquote>json_file = open(pretrained_model_path, ‘r’)</blockquote><blockquote>classifier = model_from_json(json_file.read())</blockquote><blockquote>classifier.load_weights(pretrained_weights_path)</blockquote><blockquote>classifier.compile(loss=’categorical_crossentropy’, optimizer=’adam’,</blockquote><blockquote>metrics=[‘accuracy’])</blockquote><blockquote>json_file.close()</blockquote><blockquote>model = build(self.MyRNNTransformer(classifier), X, y_trans, wv_dict, corpus=X)</blockquote><blockquote># Train on the whole set from scratch</blockquote><blockquote>if verbose:</blockquote><blockquote>print(“Building complete model and saving …”)</blockquote><blockquote>model= build(self.MyRNNTransformer(classifier), X, y_trans, wv_dict, corpus=X)</blockquote><blockquote># Save the model</blockquote><blockquote>if model_name:</blockquote><blockquote>outpath = ‘Models/’</blockquote><blockquote>classifier.save_weights(outpath + model_name + ‘.h5’)</blockquote><blockquote>with open(outpath + model_name + ‘.json’, ‘w’) as json_file:</blockquote><blockquote>json_file.write(classifier.to_json())</blockquote><blockquote>print(“Model written out to {}”.format(model_name))</blockquote><blockquote>else:</blockquote><blockquote>print(‘Please provide model name for saving’)</blockquote><blockquote>return model</blockquote><p>The process of text emotion detection uses NLTK library for all text preprocessing. The Word2Vec model is used for vectorization. The LSTM-RNN model is deployed with keras library with tensorflow backend. The model is trained and tested. The user will give the input in the form text. The text is processed and emotion prediction will be return as output. Figure 14 shows the user interface for entering text comments, Figures 15 and 16 show the results of emotions detected for the given text documents.</p><p><strong><em>Webpage code to the user to enter the input text</em></strong></p><blockquote>{% block body %}</blockquote><blockquote>&lt;div class=”row”&gt;</blockquote><blockquote>&lt;div class=”column” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;blockquote&gt;</blockquote><blockquote>&lt;p class=”quotation”&gt; Tell us about the last time you showed leadership.&lt;/p&gt;</blockquote><blockquote>&lt;/blockquote&gt;</blockquote><blockquote>&lt;form action=”/text_1&quot; method=”post”&gt;</blockquote><blockquote>&lt;textarea cols=”70&quot; rows =”20&quot; name=”text”&gt;&lt;/textarea&gt;&lt;br&gt;&lt;br&gt;</blockquote><blockquote>&lt;input type=”submit” value=”Start Analysis”&gt;</blockquote><blockquote>&lt;/form&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;div class=”column” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;form action=”text_pdf” method=”post” enctype=”multipart/form-data”&gt;</blockquote><blockquote>&lt;blockquote&gt;</blockquote><blockquote>&lt;p class=”quotation”&gt; Or upload your Cover Letter : &lt;/p&gt;</blockquote><blockquote>&lt;/blockquote&gt;</blockquote><blockquote>&lt;br&gt;&lt;br&gt;</blockquote><blockquote>&lt;input type=”file” name=”file”&gt;&lt;br&gt;&lt;br&gt;</blockquote><blockquote>&lt;input type=”submit” value=”Start Analysis”&gt;</blockquote><blockquote>&lt;! — accept=”application/pdf” →</blockquote><blockquote>&lt;/form&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2PXe3Hsd9UNRXfnEl0zbmQ.png" /><figcaption>Figure 14. Webpage for the user to enter text comments</figcaption></figure><p><strong><em>Webpage code to display the results in Graphs</em></strong></p><blockquote>{% block body %}</blockquote><blockquote>&lt;div class=”row”&gt;</blockquote><blockquote>&lt;h2&gt;&lt;i&gt;Perceived Psychological Traits&lt;/i&gt;&lt;/h2&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;div class=”column_home” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;div&gt;&lt;div class=”legend1&quot;&gt;</blockquote><blockquote>&lt;div class=”legend1&quot;&gt; &lt;p class=”country-name”&gt;</blockquote><blockquote>&lt;span class=”key-dot you”&gt;&lt;/span&gt;You&lt;/p&gt; &lt;/div&gt;</blockquote><blockquote>&lt;div class=”legend1&quot;&gt; &lt;p class=”country-name”&gt;</blockquote><blockquote>&lt;span class=”key-dot others”&gt;&lt;/span&gt;Other candidates&lt;/p&gt; &lt;/div&gt;&lt;/div&gt;&lt;div id=”histo”&gt;&lt;/div&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;div class=”column_home” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;p&gt;Your most visible trait is : &lt;/p&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;h4&gt; {{trait}} &lt;/h4&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;div class=”parent”&gt;</blockquote><blockquote>&lt;p&gt;Psychological Traits : &lt;/p&gt;</blockquote><blockquote>&lt;ul align=”left”&gt;</blockquote><blockquote>&lt;li&gt;Extraversion : {{traits[0]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Neuroticism : {{traits[1]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Agreeableness : {{traits[2]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Conscientiousness : {{traits[3]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Openness : {{traits[4]}}%&lt;/li&gt;</blockquote><blockquote>&lt;/ul&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>&lt;div class=”row”&gt;</blockquote><blockquote>&lt;h2&gt;&lt;i&gt;Other candidates&lt;/i&gt;&lt;/h2&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;div class=”column_home” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;div&gt;</blockquote><blockquote>&lt;div id=”hist_density”&gt;&lt;/div&gt;</blockquote><blockquote>&lt;/div&gt; &lt;/div&gt;</blockquote><blockquote>&lt;div class=”column_home” id=”left-col” align=”center”&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;p&gt;Their most visible trait is : &lt;/p&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;h4&gt; {{trait_others}} &lt;/h4&gt;</blockquote><blockquote>&lt;br&gt;</blockquote><blockquote>&lt;div class=”parent”&gt;</blockquote><blockquote>&lt;p&gt;Psychological Traits : &lt;/p&gt;</blockquote><blockquote>&lt;ul align=”left”&gt;</blockquote><blockquote>&lt;li&gt;Extraversion : {{probas_others[0]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Neuroticism : {{probas_others[1]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Agreeableness : {{probas_others[2]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Conscientiousness : {{probas_others[3]}}%&lt;/li&gt;</blockquote><blockquote>&lt;li&gt;Openness : {{probas_others[4]}}%&lt;/li&gt;</blockquote><blockquote>&lt;/ul&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1pJYqWTGv45TYqaLXAKQIQ.png" /><figcaption>Figure 15 Emotion Detection from Text Documents — User</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R9TkQ2FsFsHhOmpy6kOWKw.png" /><figcaption>Figure 16 Emotion Detection from Text Documents — Other Candidates</figcaption></figure><h3><strong>Conclusion</strong></h3><p>The face detection and emotion recognition are very challenging problems. They require a heavy effort for enhancing the performance measure of face detection and emotion recognition. This area of emotion recognition is gaining attention owing to its applications in various domains such as gaming, software engineering, and education. This article presented a detailed survey of the various approaches and techniques implemented for those approaches to detect human facial expressions for identification of emotions.</p><h3><strong>References</strong></h3><p>[1] Emotion Detection and Recognition Market, Markets And Markets, Published Feb 2020, <a href="https://www.marketsandmarkets.com/Market-Reports/emotion-detection-recognition-market-23376176.html">https://www.marketsandmarkets.com/Market-Reports/emotion-detection-recognition-market-23376176.html</a> [accessed on 10-Jan-2020]</p><p>[2] <a href="https://blog.hubspot.com/marketing/author/tom-shapiro">Tom Shapiro</a>, How Emotion-Detection Technology Will Change Marketing, 2017, <a href="https://blog.hubspot.com/marketing/emotion-detection-technology-marketing">https://blog.hubspot.com/marketing/emotion-detection-technology-marketing</a> [accessed on 20-Jan-2020]</p><p>[3] <a href="http://www.viralelement.com/author/perry-lara/">Perry Lara</a>, How Emotion-Detection Technology Will Change Marketing, 2017, <a href="http://www.viralelement.com/emotion-detection-technology-will-change-marketing/">http://www.viralelement.com/emotion-detection-technology-will-change-marketing/</a> [accessed on 20-Jan-2020]</p><p>[4] Antonio Damasio, This Time with Feeling, 2015, <a href="https://www.youtube.com/watch?v=IifXMd26gWE">https://www.youtube.com/watch?v=IifXMd26gWE</a> [accessed on 21-Jan-2020]</p><p>[5] Karthik Balsubramanian, “Facial Emotions Recognitions using Heuristic Learning and Transfer Learning, 2019, <a href="https://karthikbalasubramanian.github.io/ml/2019/05/17/Karthik-_FER_Capstone_Report.html">https://karthikbalasubramanian.github.io/ml/2019/05/17/Karthik-_FER_Capstone_Report.html</a> [accessed on 10-Feb-2020]</p><p>[6] Shervin Minaee, Amirali Abdolrashidi, “Deep-Emotion: Facial Expression Recognition Using Attentional Convolutional Network”, <a href="https://www.groundai.com/project/deep-emotion-facial-expression-recognition-using-attentional-convolutional-network/1">https://www.groundai.com/project/deep-emotion-facial-expression-recognition-using-attentional-convolutional-network/1</a> [accessed on 20-Feb-2020]</p><p>[7] Karla Lant, “Software that reads emotions could be used to catch criminals before they act”, Published in 2017, <a href="https://futurism.com/software-that-reads-emotions-could-be-used-to-catch-criminals-before-they-act">https://futurism.com/software-that-reads-emotions-could-be-used-to-catch-criminals-before-they-act</a> [accessed on 15-Mar-2020]</p><p>[8] Mar Saneiro, Olga C. Santos, Sergio Salmeron-Majadas, and Jesus G. Boticario, “Towards Emotion Detection in Educational Scenarios from Facial Expressions and Body Movements through Multimodal Approaches”, The Scientific Journal, 2014, doi: 10.1155/2014/484873.</p><p>[9] Pierre-Nicolas Schwab, “Customer satisfaction: can it be measured based on facial emotions”, published on May 2019. <a href="https://www.intotheminds.com/blog/en/customer-satisfaction-can-it-be-measured-based-on-facial-emotions/">https://www.intotheminds.com/blog/en/customer-satisfaction-can-it-be-measured-based-on-facial-emotions/</a> [accessed on 15-Mar-2020]</p><p>[10] Daniel Thomas, “The Cameras that know if you’re happy or a threat”, published on July 2018, <a href="https://www.bbc.com/news/business-44799239">https://www.bbc.com/news/business-44799239</a> [accessed on 15-Mar-2020]</p><p>[11] Matsugu, M., Mori, K., Mitari, Y. &amp; Kaneda, Y. (2003). Subject independent facial expression recognition with robust face detection using a convolutional neural network. Neural Networks, 16(5), 555– 559.</p><p>[12] Zhang, L. &amp; Tjondronegoro, D. (2011). Facial Expression Recognition using Facial Movement Features. IEEE Transactions on Affective Computing, 2(4), 219–229.</p><p>[13] Hayat, M. &amp; Bennamoun, M. (2014). An Automatic Framework for Textured 3D Video-Based Facial Expression Recognition. IEEE Transactions on Affective Computing, 5(3), 301–313.</p><p>[14] Lee, S.H., Plataniotis, K.N. &amp; Ro, Y.M. (2014). Intra-Class Variation Reduction Using Training Expression Images for Sparse Representation Based Facial Expression Recognition. IEEE Transactions on Affective Computing, 5(3), 340–351.</p><p>[15] Yu, Z. &amp; Zhang, C. (2015). Image based static facial expression recognition with multiple deep network learning. In proceedings of ACM on International Conference on Multimodal Interaction, (pp. 435–442), Seattle.</p><p>[16] Dornaika, F., Moujahid, A. &amp; Raducanu, B. (2013). Facial expression recognition using tracked facial actions: Classifier performance analysis. Engineering Applications of Artificial Intelligence, 26(1), 467–477.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e89d9de79f54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML and AI..]]></title>
            <link>https://medium.com/@krboobesh/ml-and-ai-5fb8afb4b4fd?source=rss-6943e6743aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fb8afb4b4fd</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[BHUBESH KRA]]></dc:creator>
            <pubDate>Wed, 27 Jun 2018 13:43:00 GMT</pubDate>
            <atom:updated>2018-06-27T13:43:00.236Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello after longtime… very glad and happy to write a blog after long time…</p><p>So what i want to share in this blog??… the leading research technology which is used by most companies like google, facebook ,amazon ,space-x ie)Machine learning and its advancements…</p><p><strong>Machine learning:</strong></p><p>So what it is??..simple just according to me it is just a task or practice given to machine to do work automatically…</p><p>automatically…. so you can ask? automatic means for eg: in washing machine just after putting up clothes and after closing we are giving up machines instructions how to wash like what is washing level by indicating it and then clicking on wash button it works… So automatic doing is already there…</p><p>If that question arises??? well and good…. but think off this scenario when you puts up your clothes in washing machine but think off what if machine suggests you a level of washing and all stuffs that you give to machine inturn think if machine suggests to you all??? how it could be…</p><p>There comes a Machine learning.. the art of making machine to learn and think..</p><p><strong>Types of Machine learning:</strong></p><p>You can divide machine learning algorithms into three main groups based on their purpose:</p><ul><li>Supervised learning</li><li>Unsupervised learning</li><li>Reinforcement learning</li></ul><h3>SUPERVISED LEARNING</h3><p><em>Supervised learning</em> occurs when an algorithm learns from example data and associated target responses that can consist of numeric values or string labels, such as classes or tags, in order to later predict the correct response when posed with new examples. The supervised approach is indeed similar to human learning under the supervision of a teacher. The teacher provides good examples for the student to memorize, and the student then derives general rules from these specific examples.</p><h3>UNSUPERVISED LEARNING</h3><p><em>Unsupervised learning</em> occurs when an algorithm learns from plain examples without any associated response, leaving to the algorithm to determine the data patterns on its own. This type of algorithm tends to restructure the data into something else, such as new features that may represent a class or a new series of uncorrelated values. They are quite useful in providing humans with insights into the meaning of data and new useful inputs to supervised machine learning algorithms.</p><h3>REINFORCEMENT LEARNING</h3><p><em>Reinforcement learning</em> occurs when you present the algorithm with examples that lack labels, as in unsupervised learning. However, you can accompany an example with positive or negative feedback according to the solution the algorithm proposes. Reinforcement learning is connected to applications for which the algorithm must make decisions (so the product is prescriptive, not just descriptive, as in unsupervised learning), and the decisions bear consequences. In the human world, it is just like learning by trial and error.</p><p><strong>learning and their usages:</strong></p><p>As far as i read supervised and unsupervised learning are most popular ones and they are mostly used in data analysis and data scientists. These learnings help them to view and analyse a set of datas using regression,classification and help them to predict a algorithm to find out best match(labels simply) for user given data.. this is supervised learning..</p><p>eg for supervised learning:</p><p>you get bunch of photos <strong>with informaton what is on them</strong> and you train a model to recognize new photos</p><p>you have bunch of molecules and <strong>information which are drugs</strong> and you train a model to answer whether new molecule is also a drug</p><p>In unsupervised learning no one user is going to label which feature is it instead after doing some logic behind some algorithm the trained model is going to identify that name correctly.</p><p>eg for unsupervised learning</p><p>you have bunch of photos of 6 people but <strong>without information who is on which one</strong> and want to <strong>divide</strong> this dataset into 6 piles, each with photos of one individual</p><p>you have molecules, part of them are drugs and part are not <strong>but you do not know which are which</strong> and you want algorithm to discover the drugs</p><p>In both supervised and unsupervised learning we may find data analysis and converting them into arrays and then it these arrays are used to train a model and they go for several algorithms to train a model…</p><p>so therefore they use python libraries like pandas for importing data sets , numpy for converting data into arrays , and scikit-learn for using some machine learning algorithms..like regression and classification etc..</p><p>with most use of this competitions are held and also people makes software like tableau for data analysis too use it. And also these algorithms plays a important role in face,image detections..</p><p><strong>REINFORCEMENT LEARNING AND USAGES:</strong></p><p>This is the 3rd and most interesting part in ml where all top companies like google, space x and facebook works to develop more complex and simple algorithms for it..</p><p>Here a dataset comes from environment where the agent is trained to interact with the user or game or anything with environment.. Mostly so far a model was trained by deep minds to the defeat the world champion in particular game and it was bought by google.which is the great real time example for this…</p><p>More and more algorithms like neural networks,q learning and deep q learning are devised but the real important thing in this these algorithms are so far trained and it is successful at only computer gaming level…</p><p><strong>REINFORCEMENT LEARNING IN AI AND ITS FUTURE:</strong></p><p>As i already said , learning which made an agent to interact is reinforcement learning.. But what it can do it in AI??</p><p>AI — the capability of a machine to imitate intelligent human behavior a simple defintion..</p><p>here to imitate man the agent(computer or robot) is devised to learn about all human behaviours.. and then the machine able to find out the best character and worst character from man.. as what they are trying AI..</p><p>I also had some ideas in it.. but apart from it if this gonna be a success…</p><p>Then AI field can give:</p><ol><li>A human like you and me and if algorithm is strong then better than you and me.</li><li>As musk said “we don’t need a machine for things human can do but we need a machine for humans cannot do” one such research is making movement of man from earth to mars.. what musk trying</li></ol><p>3. last but not least : To open up i have no faith in god or ghost.. but those have belief see with this AI concepts we can even create god’s behaviour as tamil literature has lot of stories about it… eg: you can even create even raman and ravanan from ramayana where all characters are listed the poet by kambar..</p><p>4. Assistant like google assistant and more smarter than google assistant can also be build</p><p>mostly used language in Ml is python and r… but with other languages we can also used build algorithms…</p><p><strong>CONCLUSION:</strong></p><p>As there as fear there whether AI replaces human jobs… one idea i can gave for it is… don’t make a intelligent machine just make a machine without feelings but with talents…</p><p>Thank you..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fb8afb4b4fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tech Startups a detailed analysis:]]></title>
            <link>https://medium.com/@krboobesh/tech-startups-a-detailed-analysis-b4e2616fec09?source=rss-6943e6743aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4e2616fec09</guid>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[BHUBESH KRA]]></dc:creator>
            <pubDate>Sun, 11 Mar 2018 10:21:06 GMT</pubDate>
            <atom:updated>2018-03-11T10:21:06.106Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction:</strong></h3><p>A tech startup a big era till now,out of 100 startups in each year only 2 or 3 able to came up till last in tech race.So i have a big doubt what is the reason behind for this most number of failures, whether it is matter of ideas failure or matter of people not admiring the product??……<strong>”My dream is to startoff a company which admires atleast a community of people”</strong></p><h3><strong>Major Pitfalls Suggested from many websites:</strong></h3><p>I have gone through 10 to 15 sites for the reasons for failure. And finally i came to a conclusion that,points that are discussed on those 15 websites can be categorized into major 3 areas:</p><ol><li>Fund</li><li>Market</li><li>Main theme</li></ol><p>Most startups have been started without a major funding. ie. For example</p><p>A startup which provide a e-commerce service to users need to maintain users data in well secured data centers. Paying a rent to data centers is not feasible if that service has no recognition among people. And also if a product fails the company needs a small backup funds to overcome some major areas of failure in that ideas.</p><p>Secondly a fund alone cannot move a startup in a progressive manner, MARKET a major issue in all types of startups not only in tech. Major tech leaders and big CEO’s like</p><p><strong>STEVE JOBS — APPLE</strong></p><p><strong>BILLGATES — MICROSOFT</strong></p><p>etc. had instructed about marketing at D11 conference once in 2007. Their ideas are entirely not going to help to capture market in this competitive world but somehow we can get a overall picture how to capture people’s attraction towards the product.</p><p>Capturing a market is not easy as playing a game or writing a stuff bits of code it is a thing where people’s mind analysis and a particular need for the product should exist in the market to get succeed in a particular type of service that tech company provides.</p><p>Finally idea and main theme of project of startup should not change till end.</p><p>I.E) The service provided by the startup should not change for any reasons (or) you should not confuse the people by saying some rumours that your product doesn’t give to the user.</p><h3><strong>A counter to some pitfalls and my analysis till now in startups:</strong></h3><p><strong>“Look i am not a CEO to any company what points i am sharing here is not a advice to any companies but it is just a beginning to my path to lead my dream further..”</strong></p><p>Lets move on….</p><ol><li>A point that most websites shared as reason for failure is funds. ok i am not going to oppose this point, fund is needed for all type of startups fine. But see where comes this fund concept? listen whenever you are starting a company your are not definitely not going to setup a big infrastructure so fund is not a major issue in failure. But somehow it matters see if you start your company in old garage as like <strong>APPLE </strong>or in hostel room as like <strong>MICROSOFT </strong>then there is no separate funding for space,to place all your components. See this is applicable to only to tech startup, since only in tech startup,the components to start-off a company depends only on computer and software in major kinds, and in some minor kinds like IOT based startup needs some hardware devices which will not occupy much space.</li></ol><p>Now you can ask me a question if there is no space like garage or hostel room where to start-off?</p><p>See if there is no space like that then you need to pay off rent to owners of the place where you are starting off. But some of suggestions are:</p><p>i) Don’t invest your valuable money in buying a own place to start-off because place is not important but your idea is more important. if your idea fails then its a total waste of buying that place. But if idea succeeds then you can buy a place with new confidence. But don’t place your footsteps long in anything place your steps by thinking different consequences.</p><p>ii) Secondly components, you can ask me so somehow if i am doing a network based startup i need some big components to start-off what can i do?. Simple here your idea matters if idea is really needed in market just start-off your work but do not kick to start-off such big infrastructure just use virtualization softwares to find how your ideas are executing if that idea is perfect go for loan, again it is not a big solution. I am saying when your idea is perfect go for loan and there is no guarantee that your product will be success in the market.</p><p>(another suggestion if you want a start off companies that has big infrastructure first find way to fund you regularly like a small work or doing a job in a company something like that it will boost your confidence to take your idea to next level).</p><p>2. Secondly market, people now a days are very much interested in admirin something special to them. For eg amazon offers based on users categories and their purchase , google’s products that satisfy special needs of individual user etc.. So covering people’s market is the biggest and foremost in starting of a big tech lead.</p><p>Look people do not see ideas eg: amazon and flipkart</p><p>Amazon — founded in the year 1994</p><p>Flipkart — founded in the year 2006</p><p>But amazon captured people’s market far away from the filpkart because filpkart has some good and bad reviews over their product but amazon products are totally good than filpkart.</p><p>The major reason why amazon lead filpkart is not that idea but their way of marketing people differs.</p><p>(<strong>WHEN PRODUCT DEVELOPED IN DEVELOPED COUNTRY IT IS EASY TO MARKET THAT PRODUCT IN BOTH DEVELOPED AND DEVELOPING COUNTRIES… BUT WHEN THE PRODUCT DEVELOPED IN COUNTRY WHICH IS IN DEVELOPING STAGE IT IS BIGGEST DIFFICULT FOR THE COMPANY TO MARKET THEM IN THE DEVELOPED COUNTRY..THAT’S WHY AMAZON HAS GREAT LEAD OVER IN E-COMMERCE MARKET).</strong></p><p>amazon — developed at USA</p><p>filpkart -developed at india</p><p>You can ask me a question amazon founded in 1994 but filpkart comes in only in 2005 so it is obvious that amazon has a lead over them???</p><p>Speaking about this who came first…. We can take examples of yahoo and google.Yahoo was founded before google…. But today who is the giant in that??? think offf…….</p><p>(<strong>WHO CAME FIRST IS NOT MATTER HOW YOU ATTRACT PEOPLE THAT MATTERS THAT’S WHAT GOOGLE IS DOING TILL NOW…)</strong></p><p>3. Finally your idea matters. Listen on my point of view your idea need not be innovative as much.. for eg if you take some ideas like e-commerce…. you know your idea is existing already and we had some giants like amazon..</p><p>But if you want to succeed with the same idea do what big pioneers failed to do??? IE (<strong>you should be different from all of the e-commerce companies atleast in anyone of the area)..</strong></p><p>for eg: MY IDEA FOR E-COMMERCE IS USING MACHINE LEARNING ALGORTHIMS IN SUGGESTIONS PLACE.</p><p>Usage of machine learning is till now only with the already existing data sets but you can do these with datas that are dynamically changing.</p><p>As simple i can say people will able to see quick suggestions and guesses in more comfort manner than now if ml is used in that.</p><p>My idea is just a glimpse but we can do a lot in that tooo……</p><h3>CONCLUSION:</h3><h3>“Marketing is not just people asks and company gives.. It is the fact that people should gain an importance of service provided by a company and they should not forget that till their death”</h3><p>THANK YOU…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4e2616fec09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PYTHON VS JAVA… IN FUTURE CAN PYTHON REPLACE JAVA???]]></title>
            <link>https://medium.com/@krboobesh/python-vs-java-in-future-can-python-replace-java-3b8dad193643?source=rss-6943e6743aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b8dad193643</guid>
            <dc:creator><![CDATA[BHUBESH KRA]]></dc:creator>
            <pubDate>Sat, 13 Jan 2018 13:53:28 GMT</pubDate>
            <atom:updated>2018-01-13T13:53:28.808Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What inspired me?</strong></p><p>Just now i completed my reading about the python vs c# . I worked little in c#.ya u can do most in c# but it runs only on a compatible environment i.e. if you run asp.net application (web application) it runs automatically on internet explorer only. But python a platform independent application..In that war python wins.</p><p><strong>Reason for writing this:</strong></p><p>To be frank, i don’t need java to rule all times in apps and some enterprise applications. What is less in python or what is more in java?…So come let’s see the language differences.</p><p><strong>My dream:</strong></p><p>So my future dream my desire is to make developers to use python for all purposes ie… for apps,for websites,for writing os even….</p><p><strong>Python-The king of libraries:</strong></p><p>Python a library master you had libraries for all data science,for ai even for mathematical computations etc.</p><p>Some of the python libraries:-</p><p>Scrapy: For web scrapping just like your API’S ie. using needed data from other sites using json or simply html links of proper routing. python helps to scrap data with Scrapy.</p><p>Tkinter,wxpython:A gui buliders of python used for making interactive gui for desktop apps enterprise apps etc.. also for front end in flask development.</p><p>Numpy: How can we leave this very important library ? It provides some advance math functionalities to python.</p><p><a href="http://matplotlib.sourceforge.net/">matplotlib</a>. A numerical plotting library. It is very useful for any data scientist or any data analyzer.</p><p>pygame: for developing games.</p><h3>etc… these are just a part in a universe….. lots lots and lots of libraries are there for python which is uncountable still developing and we can’t use all and we can’t learn a simple advice.</h3><p><strong>Java :</strong></p><p>I understand java has libraries which can do most as like python like web for eg. and for apps all would say blindly java and android combination. OK FINE!….for how many years you use this??java apps are still from 2000…. so why we won’t change that think about it???.Most games still are java powered and machines are running mostly with jvm’s. Remember i am not saying that java is totally waste, but see they are used from 90’s to till now. So something over ruling the tech industry for long time…</p><p>Though java apps are really good indeed. On play store all the apps mostly 95% are developed only with java.This craze over java and less knowledge about python must be ruled out.</p><h3><strong>Python vs java:</strong></h3><h4>Dynamic vs Static Typing</h4><p>One of the biggest differences between Python and Java is the way that each language handles variables. Java forces you to define the type of a variable when you first declare it and will not allow you to change the type later in the program. This is known as static typing. In contrast, Python uses dynamic typing, which allows you to change the type of a variable, by replacing an integer with a string, for example.</p><p>Dynamic typing is easier for the novice programmer to get to grips with, because it means you can just use your variables as you want to without worrying too much about their types. However, many developers would argue that static typing reduces the risk of undetected errors plaguing your program. When variables do not need to be explicitly declared before you use them, it is easy to misspell a variable name and accidentally create a whole new variable.</p><h4>Speed vs Portability</h4><p>The great advantage of Java is that it can be used to create platform-independent applications. Any computer or mobile device that is able to run the Java virtual machine can run a Java application, whereas to run Python programs you need a compiler that can turn Python code into code that your particular operating system can understand. Thanks to the popularity of Java for web applications and simple desktop programs, most devices already have the Java virtual machine installed, so a Java programmer can be confident that their application will be usable by almost all users. The disadvantage of running inside a virtual machine is that Java programs run more slowly than Python programs.</p><p><strong>Python apps the future:</strong></p><p>Till now for downloading a app, you are just doing this</p><p>i) going to playstore (again a android app).</p><p>ii)Searching for apps and clicking on install.</p><p>ok fine looks good. Now think app that used in android can be used in ios???</p><p>obviously answer is no. So come lets see a new way here..</p><p>i) first think you can download a app without worrying what platform you are using either android or ios.</p><p>ii) So you can ask me. haan whats the problem android developers of world will contribute to android and ios developers will develop for ios…. Lets see</p><p>Listen for example a company is trying to develop a app for both ios and android.</p><p>i) hire android developers and their salaries.</p><p>ii) hire ios developers to make content and looks of android app to fit in ios apps.</p><p>now say implementation cost???? you need to pay for both group.</p><p>So now you see if i use libraries just a libraries for developing a app… and just uploaded in the internet more technically a site with domain name will show you all the apps that run in both android and ios. you just click install use that where you want.. haha….</p><p>There is another problem you can ask me. hey dude is there same libraries for both android and ios app??</p><p>Simply the answer is no. you need to use two different libraries.Bit shocking right…Now your doubt again implementation cost is close to developing android or ios app?…</p><p>Again i am saying your language java is platform independent. But it can only do android apps. Your changing the language totally for ios.Here in python i am not changing the language just a library.</p><p>“IN THIS WORLD THERE ARE ONLY LANGUAGE DEVELOPERS”. if i know python then i would say i can develop something.Because if you learn python, learning a library is not just a big matter it can be accomplished in 2 or 3 days.</p><p>So now say about implementation cost?? after reading this…</p><p><strong>Finally:</strong></p><p>I don’t know whether future python replacement is possible or not?? but i will strive hard to make such things for a huge tech replacement.</p><p>If you really think my idea was good just share your thoughts guys lets join and explore the world.</p><p>JUST TEXT ME??after reading this…</p><p>THANK YOU.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b8dad193643" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MY WEB DEVELOPMENT USING FLASK PYTHON AND PHP WITHOUT (FRAMEWORKS):]]></title>
            <link>https://medium.com/@krboobesh/my-web-development-using-flask-python-and-php-without-frameworks-b2644b28971e?source=rss-6943e6743aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2644b28971e</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[BHUBESH KRA]]></dc:creator>
            <pubDate>Fri, 05 Jan 2018 16:27:51 GMT</pubDate>
            <atom:updated>2018-01-05T16:27:51.676Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>MY WEB DEVELOPMENT USING FLASK PYTHON AND PHP WITHOUT (FRAMEWORKS):</strong></p><p><strong>WHAT I DID TILL NOW?:</strong></p><p>Hi Friends!</p><p>Till from second semester, I have started learning about web development in various frameworks. But I didn’t use it in any of my college projects. But I have practiced in PHP for developing a site like Amazon. It is in half way through, because still I need to learn different technologies to make more efficient in this business.</p><p><strong>MY FUTURE DREAM:</strong></p><p>As part of my career, I don’t need to work for any organization. With my ideas, I wish to start a company and to grow big to provide service to the people.</p><p><strong>COMING TO THE FLASK:</strong></p><p>So now coming to Flask framework.I have chosen flask framework instead of Django framework.. The reason for choosing the flask framework is that It is used to create the applications that don’t give much information to the user but provides more functionality to the user.</p><p>Consider a example:A user clicks a login page to log on to the site.</p><p>In flask we can make session like the following :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*oPbbI1WRankzxwRk_cMS9g.png" /></figure><p>Just it is a username login without db. There are also libraries in Django. But what I felt is, in using Django, it is it is pretty straight forward to the user i.e… when you open a site it has only information stories. But in flask framework, we can make really fascinating and fruitful applications.</p><p>So python flask is really easy to use django framework. Though some sites are developed in Django over flask. But need a change…pretty cool…… don’t worry i will use only flask for my future development.Flask has a much lighter footprint, comprising under 10000 source lines of code to Django’s approximately 240000 lines.</p><p><strong>A TALK ON PHP WEB DEVELOPMENT:</strong></p><p>Still some sites running php one of the oldest language in the web development. Some of the amazing sites that has been founded by the technologists using php are facebook,wordpress…etc.</p><p>Coming to my experience in php development, you have lot and lot of bulit in variables. For example, consider you need get a ip address of particular user over internet who is using your site at that time. ha the big process you need to route find the ISP of the user. then country state etc. that is most drastic process. now see,,,,,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*QXz06m-Y8yYAFtgiQh12kA.png" /><figcaption>just see i blocked the local host address</figcaption></figure><p>with just 3 lines of code you get a ip address of the user. simply interesting……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*svNi9Hj44lNyxEbc54LO7Q.png" /><figcaption>haha see this that server variable take care of that,</figcaption></figure><p>I developed a e-commerce site just a simple basic site with php mysql. lots of wonders and mysteries…</p><p>I am not wishing to share how i installed and coded stuffs like that because i am not a tutorial teacher here…. i shared this blog to show my experience and what i learnt.</p><p><strong>E COMMERCE WITH PHP:</strong></p><p>As i mentioned earlier i just made a basic site of amazon with the php and mysql</p><p>some images of that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*KPBy-10R2-4knMM5Axp1gQ.png" /><figcaption>REGISTRATION PAGE TO MY ECOMMERCE SITE</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*47NzOiO5Hy7UniLTHGYjdg.png" /><figcaption>just showing dresses.</figcaption></figure><p>with php also there are many frameworks avaliable like codeigniter which i trying to use and laravel mostly used by all.</p><p><strong>A COMPARISON BETWEEN PHP AND FLASK:</strong></p><p>Both are good and unique in their own ways. On behalf of front end compatability i choose flask. because you can use both html and css and also you can use python guis like tkinter,kivy etc..</p><p>but in php html and css makes site so good and pleasing. but if we use other libraries for front end the site becomes dead slow in running on your machine itself.</p><p>Talking about js the javascript compatabilty on flask and php files.both holds good at giving response to user what your js code needed to do.</p><p><strong>DATABASE:</strong></p><p>Both php and flask are compatable with almost both sql type dbs and no sql type dbs what i used is : mysql with php,sqlite3 for flask. also we can use postrgresql and mongodb.</p><p><strong>WHAT ABOUT CLOUD STORAGE:</strong></p><p>Firebase a google product can be used to store your site datas in cloud and you can use the api of firebase and your firebase id to retrieves data. I dont like using the api’s in my application. if i get a another chance i will share my ideas on api’s.</p><p><strong>MY PROJECTS:</strong></p><p>done e commerce site in php with mysql.</p><p>in flask created a teacher online recuriting site(done at hackathon bangalore).</p><p>trying to make youtube like app,whatsapp like chat app.</p><p>Thank you……</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2644b28971e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>