Different type of difficulties and problem faced by programmer, super user and AI Creator on digital world. Some of technical solutions that faced and overcome or solve by me with this tips and tricks.
Tuesday, August 15, 2023
Super Image Resolution By Artificial Intelligence Deep Learning
Monday, August 14, 2023
MySQL Database and Table Query
MySQL Database and Table Query For Getting Desired Result.
Sunday, August 13, 2023
R Language Fetching Data From MySql Table
R Language How to Get Data From MySql Table :
install.packages("RMySQL")
library("RMySQL")Step : 2Create a connection Object to MySQL database.
We will connect to the sample database named
"DB_school" that comes with MySql installation.mysqlconnection = dbConnect(MySQL(),user='root',password='',dbname='DB_school',host='localhost')Step : 3View List the tables available in this database.dbListTables(mysqlconnection)Step : 4Query the "register" tables to get all the rows.result = dbSendQuery(mysqlconnection, "select * from registerdb")Step : 5Store the result in a R data frame object. n = 5 is used to
fetch first 5 rows.data.frame = fetch(result, n = 5) print(data.frame)Step : 6We can pass any valid select query to get the result.result = dbSendQuery(mysqlconnection, "select * from registerdb where YYYY = '2010'")Step : 7Fetch all the records(with n = -1) and store it as a data frame.data.frame = fetch(result, n = -1) print(data.frame)
Thursday, August 10, 2023
Face Recognition Smart Attendance System
FACE ATTENDANCE SYSTEM DEMOSTRATION :
STEP : 1
CHECKING WEBCAM.
STEP : 2
CAPTURE FACE BY WEBCAM & STORED IN A FOLDER.
STEP : 3
TRAINED THE FACE IMAGES BY AI.
STEP : 4
NOW RECOGNISED FACE BY WEBCAM WITH AI.
FACE ATTENDENCE SYSTEM MAKING LOGIC
FACE RECOGNITION SYSTEM THAT MACHING FACE FROM STORED MULTIPLE PERSON IMAGE WITH MAXIMUM ACCURACY
Python Code Is Now Here : (Write and Test It Proper Indentation.)
import cv2
import face_recognition
import os
import numpy as np
# Load the images from the folder
folder_path = '../userPhoto'
image_files = os.listdir(folder_path)
# Initialize arrays to store known face encodings and names
known_encodings = []
known_names = []
known_images = []
# Load the known face images and compute their encodings
for image_file in image_files:
image_path = os.path.join(folder_path, image_file)
image = face_recognition.load_image_file(image_path)
face_locations = face_recognition.face_locations(image)
if len(face_locations) > 0:
encoding = face_recognition.face_encodings(image, face_locations)[0]
known_encodings.append(encoding)
known_names.append(os.path.splitext(image_file)[0])
known_images.append(cv2.resize(image, (100, 100))) # Resize image for thumbnail display
# Initialize the webcam
video_capture = cv2.VideoCapture(0)
while True:
# Capture frame-by-frame from the webcam
ret, frame = video_capture.read()
# Convert the frame to RGB for face recognition
rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# Detect faces in the frame
face_locations = face_recognition.face_locations(rgb_frame)
face_encodings = face_recognition.face_encodings(rgb_frame, face_locations)
# Iterate over detected faces
for (top, right, bottom, left), face_encoding in zip(face_locations, face_encodings):
# Compare the face with known encodings
distances = face_recognition.face_distance(known_encodings, face_encoding)
min_distance_index = np.argmin(distances)
min_distance = distances[min_distance_index]
if min_distance <= 0.45: # Adjust the threshold as needed
name = known_names[min_distance_index]
accuracy = (1 - min_distance) * 100 # Calculate accuracy percentage
thumbnail = known_images[min_distance_index]
# Draw a rectangle around the face
cv2.rectangle(frame, (left, top), (right, bottom), (0, 255, 0), 2)
# Display the name and accuracy below the face rectangle
text = f"{name}: {accuracy:.2f}%"
cv2.putText(frame, text, (left, bottom + 20), cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 255, 0), 1)
# Display the thumbnail image in the top right corner
frame[10:110, frame.shape[1] - 110:frame.shape[1] - 10] = thumbnail
else:
name = "Unknown"
# Draw a rectangle around the face
cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)
# Display the name below the face rectangle
cv2.putText(frame, name, (left, bottom + 20), cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 1)
# Display the resulting frame
cv2.imshow('Face Recognition', frame)
# Quit the program if 'q' is pressed
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# Release the webcam and close windows
video_capture.release()
cv2.destroyAllWindows()
Tuesday, August 8, 2023
Time Attendance Machine Data Fetching Using PHP Code
Now You Can Get User Data By This PHP Code :Required zklibrary File
include "zklibrary.php";$zk = new ZKLibrary('192.168.1.7', 4370);$zk->connect();$zk->disableDevice();$users = $zk->getUser();
{$useridname[$key][0] = $user[0];$useridname[$key][1] = $user[1];}
$attendance = $zk->getAttendance();
<tr>
<td width="25">No</td><td>ID</td><td>Name</td><td>Role</td><td>Date</td><td>Time</td>
</tr>
Friday, August 4, 2023
Big Size MYSQL Upload XAMPP phpMyAdmin Panel
XAMPP Apache + MariaDB + PHP
Main Problem Is That Big Size MYSQL File Not Uploaded or Import in phpMyAdmin Panel.
Solving Technique Here :-
Try these different settings in C:\wamp\bin\apache\apache2.2.6\bin\php.ini
Find: post_max_size = 8M upload_max_filesize = 2M max_execution_time = 30 max_input_time = 60 memory_limit = 8M Change to: post_max_size = 750M upload_max_filesize = 750M max_execution_time = 5000 max_input_time = 5000 memory_limit = 1000M And add this to C:\wamp\bin\mysql\mysql5.0.45\my.ini: max_allowed_packet = 200M
Set Only 3 Parameters from php.ini file of your server
A. max_execution_time = 3000000 (Set as per your requirment) B. post_max_size = 4096M C. upload_max_filesize = 4096M Edit C:\xampp\phpMyAdmin\libraries\config.default.php Page $cfg['ExecTimeLimit'] = 0;
Python Blitz Bits: Zippy Snippets & Spark Projects for Instant Coding Wins
Python Blitz Bits: Zippy Snippets & Spark Projects for Instant Coding Wins
-
R Language Query Data on Excel Sheet Column Header :- Install xlsx Package :- install.packages("xlsx") Verify and Load the ...
-
FACE RECOGNITION SYSTEM THAT MACHING FACE FROM STORED MULTIPLE PERSON IMAGE WITH MAXIMUM ACCURACY Python Code Is Now Here : ( Write and Te...
-
Modern Mining Business Global Companies like Newmont Corporation (USA), Barrick Gold Corporation (Canada), AngloGold Ashanti (South Afri...








