Skip to main content

Posts

Showing posts from December, 2021

Word Counting Using HTML, CSS and JavaScript - Creation Code

Word Count: The word count is the number of  words  in a document or passage of text. Word counting may be needed when a text is required to stay within certain numbers of words. This may particularly be the case in  academia , legal proceedings,  journalism , and  advertising . Word count is commonly used by  translator s to determine the price of a translation job. Word counts may also be used to calculate measures of  readability  and to measure typing and reading speeds(usually in  words per minute ). When converting  character  count to words, a measure of 5 or 6 characters to a word is generally used for English In this post, we will use HTML, CSS, and JavaScript to make this project so let's jump into the code without wasting any time HTML: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <meta http-equiv=&q

Emotion Detection Using Machine Learning Python - Creation Code

Emotion Recognition:  Emotion recognition is the process of identifying human  emotion . People vary widely in their accuracy at recognizing the emotions of others. The use of technology to help people with emotion recognition is a relatively nascent research area. Generally, the technology works best if it uses multiple  modalities  in context. To date, most work has been conducted on automating the  recognition of facial expressions  from video. Modules and libraries: Keras - pip install keras Numpy - pip install numpy OpenCV - pip install opencv-python Note: We will use two main files which will help us to recognize faces and expressions You can download the files from  here Code: from keras . models import load_model from time import sleep from keras . preprocessing . image import img_to_array from keras . preprocessing import image import cv2 import numpy as np face_classifier = cv2 . CascadeClassifier ( cv2 .data.haarcascades + 'haarcascade_frontalface_defaul

Make a Simple Survey From Using Only HTML - Creation Code

Survey Data Collection:  With the application of probability  sampling  in the 1930s, surveys became a standard tool for  empirical research  in  social sciences ,  marketing , and official statistics. The methods involved in survey data collection are any of several ways in which data can be  collected  for a  statistical survey . First, there was the change from traditional paper-and-pencil interviewing(PAPI) to computer-assisted interviewing(CAI). Now, face-to-face surveys(CAPI), telephone surveys( CATI ), and mail surveys(CASI, CSAQ) are increasingly replaced by web surveys In this post, we will make a basic survey form with the help of HTML. In this post, we just use HTML but not CSS. You can make a style change as you want. HTML: <!DOCTYPE HTML> <html> <head>     <title>Survey</title> </head> <body>     <h1>Survey form</h1>     Enter your name:     <input type="text" name="UserName" size=35 maxlength=35

Fire Detection Using Python With OpenCV - Creation Code

Fire Detectors:  Fire detectors sense one or more of the products or phenomena resulting from fire, such as  smoke ,  heat ,  infrared , and/or  ultraviolet  light radiation, or  gas We will use our little knowledge of python and OpenCV to make this project so let's jump into the code without wasting any time Code: import cv2 import numpy as np import matplotlib . pyplot as plt live_Camera = cv2 . VideoCapture ( 0 ) lower_bound = np . array ([ 11 , 33 , 111 ]) upper_bound = np . array ([ 90 , 255 , 255 ]) while ( live_Camera .isOpened()):     ret , frame = live_Camera .read()     frame = cv2 . resize ( frame ,( 1280 , 720 ))     frame = cv2 . flip ( frame , 1 )     frame_smooth = cv2 . GaussianBlur ( frame ,( 7 , 7 ), 0 )     mask = np . zeros_like ( frame )     mask [ 0 : 720 , 0 : 1280 ] = [ 255 , 255 , 255 ]     img_roi = cv2 . bitwise_and ( frame_smooth , mask )     frame_hsv = cv2 . cvtColor ( img_roi , cv2 . COLOR_BGR2HSV )     image_binary = cv2 . inRange (

Create an Awesome Calculator Using HTML, CSS and JavaScript - Creation Code

Calculator: The first  solid-state electronic  calculator was created in the early 1960s. Pocket-sized devices became available in the 1970s, especially after the  Intel 4004 , the first  microprocessor , was developed by  Intel  for the Japanese calculator company  Busicom . They later became used commonly within the petroleum industry(oil and gas) In this post, we will create a simple calculator for use on the web with the help of HTML, CSS, and javascript HTML: <!DOCTYPE html> <html lang="en"> <head>  <meta charset="UTF-8">  <meta name="viewport" content="width=device-width, initial-scale=1.0">  <meta http-equiv="X-UA-Compatible" content="ie=edge">  <title>calculator</title>  <link rel="stylesheet" href="./style.css"> </head> <body>  <section class="calculator">   <form>    <input type="text" name="&

Create Ping Pong Game in Python

  Ping Pong Game: Table tennis , also known as  ping-pong  and  whiff-whaff , is a sport in which two or four players hit a lightweight ball, also known as the ping-pong ball, back and forth across a table using small rackets. The game takes place on a hard table divided by a net. Except for the initial serve, the rules are generally as follows: players must allow a ball played toward them to bounce once on their side of the table and must return it so that it bounces on the opposite side at least once. A point is scored when a player fails to return the ball within the rules. Play is fast and demands quick reactions. Spinning the ball alters its trajectory and limits an opponent's options, giving the hitter a great advantage. We can make it using pygame but I keep it more simple we will create this game using only the turtle module so let's drive into the code without wasting any time Code: # Import required library import turtle # Create screen sc = turtle . Screen () sc .

Draw Devil Emoje Using Pure Python

  The world got a little more mischievous in 2010 when the  Smiling Face With Horn's  emoji 😈   was approved on Unicode 6.0. It’s commonly called the  D evil  or  Happy Devil  emoji.Let's drive into the code and see how to draw devil emoji using python Code: import turtle as t t . speed ( 50 ) t . begin_fill () t . fillcolor ( '#8F0A7A' ) t . circle ( 100 ) t . end_fill () t . penup () t . left ( 90 ) t . forward ( 100 ) t . left ( 90 ) t . forward ( 23 ) t . pendown () t . pencolor ( 'black' ) t . begin_fill () t . fillcolor ( 'black' ) t . circle ( 10 ) t . end_fill () t . right (- 160 ) def eybrow ():     t . begin_fill ()     t . fillcolor ( 'black' )     for i in range ( 8 ):         t . forward (- 5 )         t . left ( 1 )     t . left ( 170 )     for i in range ( 20 ):         t . forward ( 1 )         t . right ( 5 )     t . right ( 90 )     for i in range ( 5 ):         t . forward ( 6 )         t . left (- 1 )     t . lef

Live Sketch Using Webcam in Python | Live Sketching Using OpenCV

What is a webcam? A webcam is a  video camera  that feeds or  streams  an image or video in real-time to or through a  computer network , such as the  Internet . Webcams are typically small cameras that sit on a desk, attach to a user's monitor, or are built into the hardware(such as a laptop's front camera). Webcams can be used during a  video chat  session involving two or more people, with conversations that include live audio and video. In this post, we will use this webcam to convert any live video to a sketch with the help of OpenCV using python so let's drive into the code First import the required libraries import cv2 import numpy as np The function for sketching # Our sketch generating function def sketch ( image ):     # Convert image to grayscale     img_gray = cv2 . cvtColor ( image , cv2 . COLOR_BGR2GRAY )         # Clean up image using Guassian Blur     img_gray_blur = cv2 . GaussianBlur ( img_gray , ( 5 , 5 ), 0 )         # Extract edges     canny_edge

How to Draw Doremon in Python

  Doraemon  is a fictional character in the Japanese manga  and anime  series of the same name  created by  Fujiko Fujio , the pen  of writing team Hiroshi Fujimoto and Motoo Abiko. He is a male robotic cat  that travels back in time from the 22nd century to aid a preteen boy named Nobita . An "official" birth certificate for the character gives him a birth date of 3 September 2112 and lists his city of residency  the city where the manga was created.  In 2008. In this post, we gonna draw it by computer using python so let's drive into the code Code: from turtle import * # Doraemon with Python Turtle def pyt ( x , y ):     penup ()     goto ( x , y )     pendown () def eyes ():     fillcolor ( "#ffffff" )     begin_fill ()     tracer ( False )     a = 2.5     for i in range ( 120 ):         if 0 <= i < 30 or 60 <= i < 90 :             a -= 0.05             lt ( 3 )             fd ( a )         else :             a += 0.05