import face_recognition # used for recognizing face import cv2 # used for accessing system camera import os # used for accessing directory from datetme import datetime , timedelta import pandas as pd # This library is used for operations on dataframe and CSV file import numpy as np # For handling numerical operations (like face distance comparison) # Function to encode faces from images in a directory def encode_faces ( directory ): known_faces = [] known_names = [] print ( os . listdir ( directory )) # Loop through each file in the directory and check if it's a valid image format or not for filename in os . listdir ( directory ): if filename .endswith(( ".jpg" , ".png" )): print ( "Filename:" , filename ) image_path = os . path . join ( directory , filename ) image = face_recognition . load_image_ file ( image_path )...
Posts
How to make personal ai using python || Jarvish ai using python
- Get link
- X
- Other Apps
CODE : import pyttsx3 #pip install wikipedia import speech_recognition as sr #pip install speechRecognition import datetime import wikipedia #pip install wikipedia import webbrowser import os import smtplib engine = pyttsx3 .init( 'sapi5' ) #sapi5 is used for ai voice voices = engine .getProperty( 'voices' ) # print(voices[1].id) engine .setProperty( 'voice' , voices [ 0 ].id) #there are two ai voice 0 and 1 def speak ( audio ): engine .say( audio ) engine .runAndWait() def wishme (): speak ( "Hii,< YOUR NAME >" ) hour = int ( datetime . datetime . now (). hour ) if hour >= 0 and hour < 12 : speak ( "Good morning!" ) elif hour >= 12 and hour < 18 : speak ( "Good Afternoon!" ) else : speak ( "Good Evening!" ) speak ( "I am jarvish ai," ) ...
How to make car racing game using python languge
- Get link
- X
- Other Apps
About the game: This code is a simple implementation of a car racing game using the Pygame library in Python. Here's an explanation of the key components: 1. **Initialization:** - The Pygame library is initialized. - A window is created with a size of 800x600 pixels, titled "CAR RACING." 2. **Image Loading:** - Images such as the car, grass, road strips, and obstacles are loaded using `pygame.image.load()`. 3. **Functions:** - `background()`: Draws the background elements (grass, road strips) on the screen. - `car(x, y)`: Displays the player's car at the specified coordinates. - `obstacle(obs_x, obs_y, obs)`: Displays enemy cars (obstacles) based on the given parameters. - `sc(car_passed, score)`: Displays the number of cars passed and the player's score. - `text(text, font)`: Renders text with a specified font. 4. **Game Loop (`game_loop()`):** - Handles user input event...
How to make tic tac toe game using python || Tic tac toe game using python
- Get link
- X
- Other Apps
Tic Tac Toe Game Using Python: Description: 1. Board Representation: The game board is represented using a list called board, with each element corresponding to a position on the board. 2. Players and Marks: Players are identified as Player 1 (X) and Player 2 (O). The variable Mark keeps track of the current player's symbol. 3. Win/Drawing Conditions: The game checks for win/draw conditions after each move. The CheckWin() function determines if a player has won or if the game is a draw. 4. Displaying the Board : The DrawBoard() function displays the current state of the board. 5. Game Loop: The main game loop continues until there's a winner or a draw. Players take turns entering their moves, and the board is updated accordingly. 6. *Clearing the Console:* The os.system('cls') command is used to clear the console, providing a cleaner display during the game. 7. User Input: Players input their moves by entering a position number between 1 and 9. 8. Player Names: Th...
How to make travel website using html and css? ||How to make Tourism website using html and css? || How to make travel website ||How to make tourism website
- Get link
- X
- Other Apps
Travel Website Tourism Home Gallery Places Feedback Sign Up Travel With Us in Gujarat ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Learn More Rani ki Vaav rani ki vaav .com">Rani ki vaav StatueOfUnity Statue Of Unity Saputara Saputara Design By Nikesh Patel