35 skills found · Page 1 of 2
Xiaoqi-Zhao-DLUT / MSNet M2SNet(MICCAI 2021 [MSNet] & MICCAI 2022 GOALS Challenge [M2SNet]) Multi-scale in Multi-scale Subtraction Network for Medical Image Segmentation
sayantann11 / All Classification Templetes For MLClassification - Machine Learning This is ‘Classification’ tutorial which is a part of the Machine Learning course offered by Simplilearn. We will learn Classification algorithms, types of classification algorithms, support vector machines(SVM), Naive Bayes, Decision Tree and Random Forest Classifier in this tutorial. Objectives Let us look at some of the objectives covered under this section of Machine Learning tutorial. Define Classification and list its algorithms Describe Logistic Regression and Sigmoid Probability Explain K-Nearest Neighbors and KNN classification Understand Support Vector Machines, Polynomial Kernel, and Kernel Trick Analyze Kernel Support Vector Machines with an example Implement the Naïve Bayes Classifier Demonstrate Decision Tree Classifier Describe Random Forest Classifier Classification: Meaning Classification is a type of supervised learning. It specifies the class to which data elements belong to and is best used when the output has finite and discrete values. It predicts a class for an input variable as well. There are 2 types of Classification: Binomial Multi-Class Classification: Use Cases Some of the key areas where classification cases are being used: To find whether an email received is a spam or ham To identify customer segments To find if a bank loan is granted To identify if a kid will pass or fail in an examination Classification: Example Social media sentiment analysis has two potential outcomes, positive or negative, as displayed by the chart given below. https://www.simplilearn.com/ice9/free_resources_article_thumb/classification-example-machine-learning.JPG This chart shows the classification of the Iris flower dataset into its three sub-species indicated by codes 0, 1, and 2. https://www.simplilearn.com/ice9/free_resources_article_thumb/iris-flower-dataset-graph.JPG The test set dots represent the assignment of new test data points to one class or the other based on the trained classifier model. Types of Classification Algorithms Let’s have a quick look into the types of Classification Algorithm below. Linear Models Logistic Regression Support Vector Machines Nonlinear models K-nearest Neighbors (KNN) Kernel Support Vector Machines (SVM) Naïve Bayes Decision Tree Classification Random Forest Classification Logistic Regression: Meaning Let us understand the Logistic Regression model below. This refers to a regression model that is used for classification. This method is widely used for binary classification problems. It can also be extended to multi-class classification problems. Here, the dependent variable is categorical: y ϵ {0, 1} A binary dependent variable can have only two values, like 0 or 1, win or lose, pass or fail, healthy or sick, etc In this case, you model the probability distribution of output y as 1 or 0. This is called the sigmoid probability (σ). If σ(θ Tx) > 0.5, set y = 1, else set y = 0 Unlike Linear Regression (and its Normal Equation solution), there is no closed form solution for finding optimal weights of Logistic Regression. Instead, you must solve this with maximum likelihood estimation (a probability model to detect the maximum likelihood of something happening). It can be used to calculate the probability of a given outcome in a binary model, like the probability of being classified as sick or passing an exam. https://www.simplilearn.com/ice9/free_resources_article_thumb/logistic-regression-example-graph.JPG Sigmoid Probability The probability in the logistic regression is often represented by the Sigmoid function (also called the logistic function or the S-curve): https://www.simplilearn.com/ice9/free_resources_article_thumb/sigmoid-function-machine-learning.JPG In this equation, t represents data values * the number of hours studied and S(t) represents the probability of passing the exam. Assume sigmoid function: https://www.simplilearn.com/ice9/free_resources_article_thumb/sigmoid-probability-machine-learning.JPG g(z) tends toward 1 as z -> infinity , and g(z) tends toward 0 as z -> infinity K-nearest Neighbors (KNN) K-nearest Neighbors algorithm is used to assign a data point to clusters based on similarity measurement. It uses a supervised method for classification. The steps to writing a k-means algorithm are as given below: https://www.simplilearn.com/ice9/free_resources_article_thumb/knn-distribution-graph-machine-learning.JPG Choose the number of k and a distance metric. (k = 5 is common) Find k-nearest neighbors of the sample that you want to classify Assign the class label by majority vote. KNN Classification A new input point is classified in the category such that it has the most number of neighbors from that category. For example: https://www.simplilearn.com/ice9/free_resources_article_thumb/knn-classification-machine-learning.JPG Classify a patient as high risk or low risk. Mark email as spam or ham. Keen on learning about Classification Algorithms in Machine Learning? Click here! Support Vector Machine (SVM) Let us understand Support Vector Machine (SVM) in detail below. SVMs are classification algorithms used to assign data to various classes. They involve detecting hyperplanes which segregate data into classes. SVMs are very versatile and are also capable of performing linear or nonlinear classification, regression, and outlier detection. Once ideal hyperplanes are discovered, new data points can be easily classified. https://www.simplilearn.com/ice9/free_resources_article_thumb/support-vector-machines-graph-machine-learning.JPG The optimization objective is to find “maximum margin hyperplane” that is farthest from the closest points in the two classes (these points are called support vectors). In the given figure, the middle line represents the hyperplane. SVM Example Let’s look at this image below and have an idea about SVM in general. Hyperplanes with larger margins have lower generalization error. The positive and negative hyperplanes are represented by: https://www.simplilearn.com/ice9/free_resources_article_thumb/positive-negative-hyperplanes-machine-learning.JPG Classification of any new input sample xtest : If w0 + wTxtest > 1, the sample xtest is said to be in the class toward the right of the positive hyperplane. If w0 + wTxtest < -1, the sample xtest is said to be in the class toward the left of the negative hyperplane. When you subtract the two equations, you get: https://www.simplilearn.com/ice9/free_resources_article_thumb/equation-subtraction-machine-learning.JPG Length of vector w is (L2 norm length): https://www.simplilearn.com/ice9/free_resources_article_thumb/length-of-vector-machine-learning.JPG You normalize with the length of w to arrive at: https://www.simplilearn.com/ice9/free_resources_article_thumb/normalize-equation-machine-learning.JPG SVM: Hard Margin Classification Given below are some points to understand Hard Margin Classification. The left side of equation SVM-1 given above can be interpreted as the distance between the positive (+ve) and negative (-ve) hyperplanes; in other words, it is the margin that can be maximized. Hence the objective of the function is to maximize with the constraint that the samples are classified correctly, which is represented as : https://www.simplilearn.com/ice9/free_resources_article_thumb/hard-margin-classification-machine-learning.JPG This means that you are minimizing ‖w‖. This also means that all positive samples are on one side of the positive hyperplane and all negative samples are on the other side of the negative hyperplane. This can be written concisely as : https://www.simplilearn.com/ice9/free_resources_article_thumb/hard-margin-classification-formula.JPG Minimizing ‖w‖ is the same as minimizing. This figure is better as it is differentiable even at w = 0. The approach listed above is called “hard margin linear SVM classifier.” SVM: Soft Margin Classification Given below are some points to understand Soft Margin Classification. To allow for linear constraints to be relaxed for nonlinearly separable data, a slack variable is introduced. (i) measures how much ith instance is allowed to violate the margin. The slack variable is simply added to the linear constraints. https://www.simplilearn.com/ice9/free_resources_article_thumb/soft-margin-calculation-machine-learning.JPG Subject to the above constraints, the new objective to be minimized becomes: https://www.simplilearn.com/ice9/free_resources_article_thumb/soft-margin-calculation-formula.JPG You have two conflicting objectives now—minimizing slack variable to reduce margin violations and minimizing to increase the margin. The hyperparameter C allows us to define this trade-off. Large values of C correspond to larger error penalties (so smaller margins), whereas smaller values of C allow for higher misclassification errors and larger margins. https://www.simplilearn.com/ice9/free_resources_article_thumb/machine-learning-certification-video-preview.jpg SVM: Regularization The concept of C is the reverse of regularization. Higher C means lower regularization, which increases bias and lowers the variance (causing overfitting). https://www.simplilearn.com/ice9/free_resources_article_thumb/concept-of-c-graph-machine-learning.JPG IRIS Data Set The Iris dataset contains measurements of 150 IRIS flowers from three different species: Setosa Versicolor Viriginica Each row represents one sample. Flower measurements in centimeters are stored as columns. These are called features. IRIS Data Set: SVM Let’s train an SVM model using sci-kit-learn for the Iris dataset: https://www.simplilearn.com/ice9/free_resources_article_thumb/svm-model-graph-machine-learning.JPG Nonlinear SVM Classification There are two ways to solve nonlinear SVMs: by adding polynomial features by adding similarity features Polynomial features can be added to datasets; in some cases, this can create a linearly separable dataset. https://www.simplilearn.com/ice9/free_resources_article_thumb/nonlinear-classification-svm-machine-learning.JPG In the figure on the left, there is only 1 feature x1. This dataset is not linearly separable. If you add x2 = (x1)2 (figure on the right), the data becomes linearly separable. Polynomial Kernel In sci-kit-learn, one can use a Pipeline class for creating polynomial features. Classification results for the Moons dataset are shown in the figure. https://www.simplilearn.com/ice9/free_resources_article_thumb/polynomial-kernel-machine-learning.JPG Polynomial Kernel with Kernel Trick Let us look at the image below and understand Kernel Trick in detail. https://www.simplilearn.com/ice9/free_resources_article_thumb/polynomial-kernel-with-kernel-trick.JPG For large dimensional datasets, adding too many polynomial features can slow down the model. You can apply a kernel trick with the effect of polynomial features without actually adding them. The code is shown (SVC class) below trains an SVM classifier using a 3rd-degree polynomial kernel but with a kernel trick. https://www.simplilearn.com/ice9/free_resources_article_thumb/polynomial-kernel-equation-machine-learning.JPG The hyperparameter coefθ controls the influence of high-degree polynomials. Kernel SVM Let us understand in detail about Kernel SVM. Kernel SVMs are used for classification of nonlinear data. In the chart, nonlinear data is projected into a higher dimensional space via a mapping function where it becomes linearly separable. https://www.simplilearn.com/ice9/free_resources_article_thumb/kernel-svm-machine-learning.JPG In the higher dimension, a linear separating hyperplane can be derived and used for classification. A reverse projection of the higher dimension back to original feature space takes it back to nonlinear shape. As mentioned previously, SVMs can be kernelized to solve nonlinear classification problems. You can create a sample dataset for XOR gate (nonlinear problem) from NumPy. 100 samples will be assigned the class sample 1, and 100 samples will be assigned the class label -1. https://www.simplilearn.com/ice9/free_resources_article_thumb/kernel-svm-graph-machine-learning.JPG As you can see, this data is not linearly separable. https://www.simplilearn.com/ice9/free_resources_article_thumb/kernel-svm-non-separable.JPG You now use the kernel trick to classify XOR dataset created earlier. https://www.simplilearn.com/ice9/free_resources_article_thumb/kernel-svm-xor-machine-learning.JPG Naïve Bayes Classifier What is Naive Bayes Classifier? Have you ever wondered how your mail provider implements spam filtering or how online news channels perform news text classification or even how companies perform sentiment analysis of their audience on social media? All of this and more are done through a machine learning algorithm called Naive Bayes Classifier. Naive Bayes Named after Thomas Bayes from the 1700s who first coined this in the Western literature. Naive Bayes classifier works on the principle of conditional probability as given by the Bayes theorem. Advantages of Naive Bayes Classifier Listed below are six benefits of Naive Bayes Classifier. Very simple and easy to implement Needs less training data Handles both continuous and discrete data Highly scalable with the number of predictors and data points As it is fast, it can be used in real-time predictions Not sensitive to irrelevant features Bayes Theorem We will understand Bayes Theorem in detail from the points mentioned below. According to the Bayes model, the conditional probability P(Y|X) can be calculated as: P(Y|X) = P(X|Y)P(Y) / P(X) This means you have to estimate a very large number of P(X|Y) probabilities for a relatively small vector space X. For example, for a Boolean Y and 30 possible Boolean attributes in the X vector, you will have to estimate 3 billion probabilities P(X|Y). To make it practical, a Naïve Bayes classifier is used, which assumes conditional independence of P(X) to each other, with a given value of Y. This reduces the number of probability estimates to 2*30=60 in the above example. Naïve Bayes Classifier for SMS Spam Detection Consider a labeled SMS database having 5574 messages. It has messages as given below: https://www.simplilearn.com/ice9/free_resources_article_thumb/naive-bayes-spam-machine-learning.JPG Each message is marked as spam or ham in the data set. Let’s train a model with Naïve Bayes algorithm to detect spam from ham. The message lengths and their frequency (in the training dataset) are as shown below: https://www.simplilearn.com/ice9/free_resources_article_thumb/naive-bayes-spam-spam-detection.JPG Analyze the logic you use to train an algorithm to detect spam: Split each message into individual words/tokens (bag of words). Lemmatize the data (each word takes its base form, like “walking” or “walked” is replaced with “walk”). Convert data to vectors using scikit-learn module CountVectorizer. Run TFIDF to remove common words like “is,” “are,” “and.” Now apply scikit-learn module for Naïve Bayes MultinomialNB to get the Spam Detector. This spam detector can then be used to classify a random new message as spam or ham. Next, the accuracy of the spam detector is checked using the Confusion Matrix. For the SMS spam example above, the confusion matrix is shown on the right. Accuracy Rate = Correct / Total = (4827 + 592)/5574 = 97.21% Error Rate = Wrong / Total = (155 + 0)/5574 = 2.78% https://www.simplilearn.com/ice9/free_resources_article_thumb/confusion-matrix-machine-learning.JPG Although confusion Matrix is useful, some more precise metrics are provided by Precision and Recall. https://www.simplilearn.com/ice9/free_resources_article_thumb/precision-recall-matrix-machine-learning.JPG Precision refers to the accuracy of positive predictions. https://www.simplilearn.com/ice9/free_resources_article_thumb/precision-formula-machine-learning.JPG Recall refers to the ratio of positive instances that are correctly detected by the classifier (also known as True positive rate or TPR). https://www.simplilearn.com/ice9/free_resources_article_thumb/recall-formula-machine-learning.JPG Precision/Recall Trade-off To detect age-appropriate videos for kids, you need high precision (low recall) to ensure that only safe videos make the cut (even though a few safe videos may be left out). The high recall is needed (low precision is acceptable) in-store surveillance to catch shoplifters; a few false alarms are acceptable, but all shoplifters must be caught. Learn about Naive Bayes in detail. Click here! Decision Tree Classifier Some aspects of the Decision Tree Classifier mentioned below are. Decision Trees (DT) can be used both for classification and regression. The advantage of decision trees is that they require very little data preparation. They do not require feature scaling or centering at all. They are also the fundamental components of Random Forests, one of the most powerful ML algorithms. Unlike Random Forests and Neural Networks (which do black-box modeling), Decision Trees are white box models, which means that inner workings of these models are clearly understood. In the case of classification, the data is segregated based on a series of questions. Any new data point is assigned to the selected leaf node. https://www.simplilearn.com/ice9/free_resources_article_thumb/decision-tree-classifier-machine-learning.JPG Start at the tree root and split the data on the feature using the decision algorithm, resulting in the largest information gain (IG). This splitting procedure is then repeated in an iterative process at each child node until the leaves are pure. This means that the samples at each node belonging to the same class. In practice, you can set a limit on the depth of the tree to prevent overfitting. The purity is compromised here as the final leaves may still have some impurity. The figure shows the classification of the Iris dataset. https://www.simplilearn.com/ice9/free_resources_article_thumb/decision-tree-classifier-graph.JPG IRIS Decision Tree Let’s build a Decision Tree using scikit-learn for the Iris flower dataset and also visualize it using export_graphviz API. https://www.simplilearn.com/ice9/free_resources_article_thumb/iris-decision-tree-machine-learning.JPG The output of export_graphviz can be converted into png format: https://www.simplilearn.com/ice9/free_resources_article_thumb/iris-decision-tree-output.JPG Sample attribute stands for the number of training instances the node applies to. Value attribute stands for the number of training instances of each class the node applies to. Gini impurity measures the node’s impurity. A node is “pure” (gini=0) if all training instances it applies to belong to the same class. https://www.simplilearn.com/ice9/free_resources_article_thumb/impurity-formula-machine-learning.JPG For example, for Versicolor (green color node), the Gini is 1-(0/54)2 -(49/54)2 -(5/54) 2 ≈ 0.168 https://www.simplilearn.com/ice9/free_resources_article_thumb/iris-decision-tree-sample.JPG Decision Boundaries Let us learn to create decision boundaries below. For the first node (depth 0), the solid line splits the data (Iris-Setosa on left). Gini is 0 for Setosa node, so no further split is possible. The second node (depth 1) splits the data into Versicolor and Virginica. If max_depth were set as 3, a third split would happen (vertical dotted line). https://www.simplilearn.com/ice9/free_resources_article_thumb/decision-tree-boundaries.JPG For a sample with petal length 5 cm and petal width 1.5 cm, the tree traverses to depth 2 left node, so the probability predictions for this sample are 0% for Iris-Setosa (0/54), 90.7% for Iris-Versicolor (49/54), and 9.3% for Iris-Virginica (5/54) CART Training Algorithm Scikit-learn uses Classification and Regression Trees (CART) algorithm to train Decision Trees. CART algorithm: Split the data into two subsets using a single feature k and threshold tk (example, petal length < “2.45 cm”). This is done recursively for each node. k and tk are chosen such that they produce the purest subsets (weighted by their size). The objective is to minimize the cost function as given below: https://www.simplilearn.com/ice9/free_resources_article_thumb/cart-training-algorithm-machine-learning.JPG The algorithm stops executing if one of the following situations occurs: max_depth is reached No further splits are found for each node Other hyperparameters may be used to stop the tree: min_samples_split min_samples_leaf min_weight_fraction_leaf max_leaf_nodes Gini Impurity or Entropy Entropy is one more measure of impurity and can be used in place of Gini. https://www.simplilearn.com/ice9/free_resources_article_thumb/gini-impurity-entrophy.JPG It is a degree of uncertainty, and Information Gain is the reduction that occurs in entropy as one traverses down the tree. Entropy is zero for a DT node when the node contains instances of only one class. Entropy for depth 2 left node in the example given above is: https://www.simplilearn.com/ice9/free_resources_article_thumb/entrophy-for-depth-2.JPG Gini and Entropy both lead to similar trees. DT: Regularization The following figure shows two decision trees on the moons dataset. https://www.simplilearn.com/ice9/free_resources_article_thumb/dt-regularization-machine-learning.JPG The decision tree on the right is restricted by min_samples_leaf = 4. The model on the left is overfitting, while the model on the right generalizes better. Random Forest Classifier Let us have an understanding of Random Forest Classifier below. A random forest can be considered an ensemble of decision trees (Ensemble learning). Random Forest algorithm: Draw a random bootstrap sample of size n (randomly choose n samples from the training set). Grow a decision tree from the bootstrap sample. At each node, randomly select d features. Split the node using the feature that provides the best split according to the objective function, for instance by maximizing the information gain. Repeat the steps 1 to 2 k times. (k is the number of trees you want to create, using a subset of samples) Aggregate the prediction by each tree for a new data point to assign the class label by majority vote (pick the group selected by the most number of trees and assign new data point to that group). Random Forests are opaque, which means it is difficult to visualize their inner workings. https://www.simplilearn.com/ice9/free_resources_article_thumb/random-forest-classifier-graph.JPG However, the advantages outweigh their limitations since you do not have to worry about hyperparameters except k, which stands for the number of decision trees to be created from a subset of samples. RF is quite robust to noise from the individual decision trees. Hence, you need not prune individual decision trees. The larger the number of decision trees, the more accurate the Random Forest prediction is. (This, however, comes with higher computation cost). Key Takeaways Let us quickly run through what we have learned so far in this Classification tutorial. Classification algorithms are supervised learning methods to split data into classes. They can work on Linear Data as well as Nonlinear Data. Logistic Regression can classify data based on weighted parameters and sigmoid conversion to calculate the probability of classes. K-nearest Neighbors (KNN) algorithm uses similar features to classify data. Support Vector Machines (SVMs) classify data by detecting the maximum margin hyperplane between data classes. Naïve Bayes, a simplified Bayes Model, can help classify data using conditional probability models. Decision Trees are powerful classifiers and use tree splitting logic until pure or somewhat pure leaf node classes are attained. Random Forests apply Ensemble Learning to Decision Trees for more accurate classification predictions. Conclusion This completes ‘Classification’ tutorial. In the next tutorial, we will learn 'Unsupervised Learning with Clustering.'
ManojKumarPatnaik / Major Project ListA list of practical projects that anyone can solve in any programming language (See solutions). These projects are divided into multiple categories, and each category has its own folder. To get started, simply fork this repo. CONTRIBUTING See ways of contributing to this repo. You can contribute solutions (will be published in this repo) to existing problems, add new projects, or remove existing ones. Make sure you follow all instructions properly. Solutions You can find implementations of these projects in many other languages by other users in this repo. Credits Problems are motivated by the ones shared at: Martyr2’s Mega Project List Rosetta Code Table of Contents Numbers Classic Algorithms Graph Data Structures Text Networking Classes Threading Web Files Databases Graphics and Multimedia Security Numbers Find PI to the Nth Digit - Enter a number and have the program generate PI up to that many decimal places. Keep a limit to how far the program will go. Find e to the Nth Digit - Just like the previous problem, but with e instead of PI. Enter a number and have the program generate e up to that many decimal places. Keep a limit to how far the program will go. Fibonacci Sequence - Enter a number and have the program generate the Fibonacci sequence to that number or to the Nth number. Prime Factorization - Have the user enter a number and find all Prime Factors (if there are any) and display them. Next Prime Number - Have the program find prime numbers until the user chooses to stop asking for the next one. Find Cost of Tile to Cover W x H Floor - Calculate the total cost of the tile it would take to cover a floor plan of width and height, using a cost entered by the user. Mortgage Calculator - Calculate the monthly payments of a fixed-term mortgage over given Nth terms at a given interest rate. Also, figure out how long it will take the user to pay back the loan. For added complexity, add an option for users to select the compounding interval (Monthly, Weekly, Daily, Continually). Change Return Program - The user enters a cost and then the amount of money given. The program will figure out the change and the number of quarters, dimes, nickels, pennies needed for the change. Binary to Decimal and Back Converter - Develop a converter to convert a decimal number to binary or a binary number to its decimal equivalent. Calculator - A simple calculator to do basic operators. Make it a scientific calculator for added complexity. Unit Converter (temp, currency, volume, mass, and more) - Converts various units between one another. The user enters the type of unit being entered, the type of unit they want to convert to, and then the value. The program will then make the conversion. Alarm Clock - A simple clock where it plays a sound after X number of minutes/seconds or at a particular time. Distance Between Two Cities - Calculates the distance between two cities and allows the user to specify a unit of distance. This program may require finding coordinates for the cities like latitude and longitude. Credit Card Validator - Takes in a credit card number from a common credit card vendor (Visa, MasterCard, American Express, Discoverer) and validates it to make sure that it is a valid number (look into how credit cards use a checksum). Tax Calculator - Asks the user to enter a cost and either a country or state tax. It then returns the tax plus the total cost with tax. Factorial Finder - The Factorial of a positive integer, n, is defined as the product of the sequence n, n-1, n-2, ...1, and the factorial of zero, 0, is defined as being 1. Solve this using both loops and recursion. Complex Number Algebra - Show addition, multiplication, negation, and inversion of complex numbers in separate functions. (Subtraction and division operations can be made with pairs of these operations.) Print the results for each operation tested. Happy Numbers - A happy number is defined by the following process. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers, while those that do not end in 1 are unhappy numbers. Display an example of your output here. Find the first 8 happy numbers. Number Names - Show how to spell out a number in English. You can use a preexisting implementation or roll your own, but you should support inputs up to at least one million (or the maximum value of your language's default bounded integer type if that's less). Optional: Support for inputs other than positive integers (like zero, negative integers, and floating-point numbers). Coin Flip Simulation - Write some code that simulates flipping a single coin however many times the user decides. The code should record the outcomes and count the number of tails and heads. Limit Calculator - Ask the user to enter f(x) and the limit value, then return the value of the limit statement Optional: Make the calculator capable of supporting infinite limits. Fast Exponentiation - Ask the user to enter 2 integers a and b and output a^b (i.e. pow(a,b)) in O(LG n) time complexity. Classic Algorithms Collatz Conjecture - Start with a number n > 1. Find the number of steps it takes to reach one using the following process: If n is even, divide it by 2. If n is odd, multiply it by 3 and add 1. Sorting - Implement two types of sorting algorithms: Merge sort and bubble sort. Closest pair problem - The closest pair of points problem or closest pair problem is a problem of computational geometry: given n points in metric space, find a pair of points with the smallest distance between them. Sieve of Eratosthenes - The sieve of Eratosthenes is one of the most efficient ways to find all of the smaller primes (below 10 million or so). Graph Graph from links - Create a program that will create a graph or network from a series of links. Eulerian Path - Create a program that will take as an input a graph and output either an Eulerian path or an Eulerian cycle, or state that it is not possible. An Eulerian path starts at one node and traverses every edge of a graph through every node and finishes at another node. An Eulerian cycle is an eulerian Path that starts and finishes at the same node. Connected Graph - Create a program that takes a graph as an input and outputs whether every node is connected or not. Dijkstra’s Algorithm - Create a program that finds the shortest path through a graph using its edges. Minimum Spanning Tree - Create a program that takes a connected, undirected graph with weights and outputs the minimum spanning tree of the graph i.e., a subgraph that is a tree, contains all the vertices, and the sum of its weights is the least possible. Data Structures Inverted index - An Inverted Index is a data structure used to create full-text search. Given a set of text files, implement a program to create an inverted index. Also, create a user interface to do a search using that inverted index which returns a list of files that contain the query term/terms. The search index can be in memory. Text Fizz Buzz - Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. Reverse a String - Enter a string and the program will reverse it and print it out. Pig Latin - Pig Latin is a game of alterations played in the English language game. To create the Pig Latin form of an English word the initial consonant sound is transposed to the end of the word and an ay is affixed (Ex.: "banana" would yield anana-bay). Read Wikipedia for more information on rules. Count Vowels - Enter a string and the program counts the number of vowels in the text. For added complexity have it report a sum of each vowel found. Check if Palindrome - Checks if the string entered by the user is a palindrome. That is that it reads the same forwards as backward like “racecar” Count Words in a String - Counts the number of individual words in a string. For added complexity read these strings in from a text file and generate a summary. Text Editor - Notepad-style application that can open, edit, and save text documents. Optional: Add syntax highlighting and other features. RSS Feed Creator - Given a link to RSS/Atom Feed, get all posts and display them. Quote Tracker (market symbols etc) - A program that can go out and check the current value of stocks for a list of symbols entered by the user. The user can set how often the stocks are checked. For CLI, show whether the stock has moved up or down. Optional: If GUI, the program can show green up and red down arrows to show which direction the stock value has moved. Guestbook / Journal - A simple application that allows people to add comments or write journal entries. It can allow comments or not and timestamps for all entries. Could also be made into a shoutbox. Optional: Deploy it on Google App Engine or Heroku or any other PaaS (if possible, of course). Vigenere / Vernam / Ceasar Ciphers - Functions for encrypting and decrypting data messages. Then send them to a friend. Regex Query Tool - A tool that allows the user to enter a text string and then in a separate control enter a regex pattern. It will run the regular expression against the source text and return any matches or flag errors in the regular expression. Networking FTP Program - A file transfer program that can transfer files back and forth from a remote web sever. Bandwidth Monitor - A small utility program that tracks how much data you have uploaded and downloaded from the net during the course of your current online session. See if you can find out what periods of the day you use more and less and generate a report or graph that shows it. Port Scanner - Enter an IP address and a port range where the program will then attempt to find open ports on the given computer by connecting to each of them. On any successful connections mark the port as open. Mail Checker (POP3 / IMAP) - The user enters various account information include web server and IP, protocol type (POP3 or IMAP), and the application will check for email at a given interval. Country from IP Lookup - Enter an IP address and find the country that IP is registered in. Optional: Find the Ip automatically. Whois Search Tool - Enter an IP or host address and have it look it up through whois and return the results to you. Site Checker with Time Scheduling - An application that attempts to connect to a website or server every so many minute or a given time and check if it is up. If it is down, it will notify you by email or by posting a notice on the screen. Classes Product Inventory Project - Create an application that manages an inventory of products. Create a product class that has a price, id, and quantity on hand. Then create an inventory class that keeps track of various products and can sum up the inventory value. Airline / Hotel Reservation System - Create a reservation system that books airline seats or hotel rooms. It charges various rates for particular sections of the plane or hotel. For example, first class is going to cost more than a coach. Hotel rooms have penthouse suites which cost more. Keep track of when rooms will be available and can be scheduled. Company Manager - Create a hierarchy of classes - abstract class Employee and subclasses HourlyEmployee, SalariedEmployee, Manager, and Executive. Everyone's pay is calculated differently, research a bit about it. After you've established an employee hierarchy, create a Company class that allows you to manage the employees. You should be able to hire, fire, and raise employees. Bank Account Manager - Create a class called Account which will be an abstract class for three other classes called CheckingAccount, SavingsAccount, and BusinessAccount. Manage credits and debits from these accounts through an ATM-style program. Patient / Doctor Scheduler - Create a patient class and a doctor class. Have a doctor that can handle multiple patients and set up a scheduling program where a doctor can only handle 16 patients during an 8 hr workday. Recipe Creator and Manager - Create a recipe class with ingredients and put them in a recipe manager program that organizes them into categories like desserts, main courses, or by ingredients like chicken, beef, soups, pies, etc. Image Gallery - Create an image abstract class and then a class that inherits from it for each image type. Put them in a program that displays them in a gallery-style format for viewing. Shape Area and Perimeter Classes - Create an abstract class called Shape and then inherit from it other shapes like diamond, rectangle, circle, triangle, etc. Then have each class override the area and perimeter functionality to handle each shape type. Flower Shop Ordering To Go - Create a flower shop application that deals in flower objects and use those flower objects in a bouquet object which can then be sold. Keep track of the number of objects and when you may need to order more. Family Tree Creator - Create a class called Person which will have a name, when they were born, and when (and if) they died. Allow the user to create these Person classes and put them into a family tree structure. Print out the tree to the screen. Threading Create A Progress Bar for Downloads - Create a progress bar for applications that can keep track of a download in progress. The progress bar will be on a separate thread and will communicate with the main thread using delegates. Bulk Thumbnail Creator - Picture processing can take a bit of time for some transformations. Especially if the image is large. Create an image program that can take hundreds of images and converts them to a specified size in the background thread while you do other things. For added complexity, have one thread handling re-sizing, have another bulk renaming of thumbnails, etc. Web Page Scraper - Create an application that connects to a site and pulls out all links, or images, and saves them to a list. Optional: Organize the indexed content and don’t allow duplicates. Have it put the results into an easily searchable index file. Online White Board - Create an application that allows you to draw pictures, write notes and use various colors to flesh out ideas for projects. Optional: Add a feature to invite friends to collaborate on a whiteboard online. Get Atomic Time from Internet Clock - This program will get the true atomic time from an atomic time clock on the Internet. Use any one of the atomic clocks returned by a simple Google search. Fetch Current Weather - Get the current weather for a given zip/postal code. Optional: Try locating the user automatically. Scheduled Auto Login and Action - Make an application that logs into a given site on a schedule and invokes a certain action and then logs out. This can be useful for checking webmail, posting regular content, or getting info for other applications and saving it to your computer. E-Card Generator - Make a site that allows people to generate their own little e-cards and send them to other people. Do not use Flash. Use a picture library and perhaps insightful mottos or quotes. Content Management System - Create a content management system (CMS) like Joomla, Drupal, PHP Nuke, etc. Start small. Optional: Allow for the addition of modules/addons. Web Board (Forum) - Create a forum for you and your buddies to post, administer and share thoughts and ideas. CAPTCHA Maker - Ever see those images with letters numbers when you signup for a service and then ask you to enter what you see? It keeps web bots from automatically signing up and spamming. Try creating one yourself for online forms. Files Quiz Maker - Make an application that takes various questions from a file, picked randomly, and puts together a quiz for students. Each quiz can be different and then reads a key to grade the quizzes. Sort Excel/CSV File Utility - Reads a file of records, sorts them, and then writes them back to the file. Allow the user to choose various sort style and sorting based on a particular field. Create Zip File Maker - The user enters various files from different directories and the program zips them up into a zip file. Optional: Apply actual compression to the files. Start with Huffman Algorithm. PDF Generator - An application that can read in a text file, HTML file, or some other file and generates a PDF file out of it. Great for a web-based service where the user uploads the file and the program returns a PDF of the file. Optional: Deploy on GAE or Heroku if possible. Mp3 Tagger - Modify and add ID3v1 tags to MP3 files. See if you can also add in the album art into the MP3 file’s header as well as other ID3v2 tags. Code Snippet Manager - Another utility program that allows coders to put in functions, classes, or other tidbits to save for use later. Organized by the type of snippet or language the coder can quickly lookup code. Optional: For extra practice try adding syntax highlighting based on the language. Databases SQL Query Analyzer - A utility application in which a user can enter a query and have it run against a local database and look for ways to make it more efficient. Remote SQL Tool - A utility that can execute queries on remote servers from your local computer across the Internet. It should take in a remote host, user name, and password, run the query and return the results. Report Generator - Create a utility that generates a report based on some tables in a database. Generates sales reports based on the order/order details tables or sums up the day's current database activity. Event Scheduler and Calendar - Make an application that allows the user to enter a date and time of an event, event notes, and then schedule those events on a calendar. The user can then browse the calendar or search the calendar for specific events. Optional: Allow the application to create re-occurrence events that reoccur every day, week, month, year, etc. Budget Tracker - Write an application that keeps track of a household’s budget. The user can add expenses, income, and recurring costs to find out how much they are saving or losing over a period of time. Optional: Allow the user to specify a date range and see the net flow of money in and out of the house budget for that time period. TV Show Tracker - Got a favorite show you don’t want to miss? Don’t have a PVR or want to be able to find the show to then PVR it later? Make an application that can search various online TV Guide sites, locate the shows/times/channels and add them to a database application. The database/website then can send you email reminders that a show is about to start and which channel it will be on. Travel Planner System - Make a system that allows users to put together their own little travel itinerary and keep track of the airline/hotel arrangements, points of interest, budget, and schedule. Graphics and Multimedia Slide Show - Make an application that shows various pictures in a slide show format. Optional: Try adding various effects like fade in/out, star wipe, and window blinds transitions. Stream Video from Online - Try to create your own online streaming video player. Mp3 Player - A simple program for playing your favorite music files. Add features you think are missing from your favorite music player. Watermarking Application - Have some pictures you want copyright protected? Add your own logo or text lightly across the background so that no one can simply steal your graphics off your site. Make a program that will add this watermark to the picture. Optional: Use threading to process multiple images simultaneously. Turtle Graphics - This is a common project where you create a floor of 20 x 20 squares. Using various commands you tell a turtle to draw a line on the floor. You have moved forward, left or right, lift or drop the pen, etc. Do a search online for "Turtle Graphics" for more information. Optional: Allow the program to read in the list of commands from a file. GIF Creator A program that puts together multiple images (PNGs, JPGs, TIFFs) to make a smooth GIF that can be exported. Optional: Make the program convert small video files to GIFs as well. Security Caesar cipher - Implement a Caesar cipher, both encoding, and decoding. The key is an integer from 1 to 25. This cipher rotates the letters of the alphabet (A to Z). The encoding replaces each letter with the 1st to 25th next letter in the alphabet (wrapping Z to A). So key 2 encrypts "HI" to "JK", but key 20 encrypts "HI" to "BC". This simple "monoalphabetic substitution cipher" provides almost no security, because an attacker who has the encoded message can either use frequency analysis to guess the key, or just try all 25 keys.
thomasvrussell / SfftSaccadic Fast Fourier Transform (SFFT) algorithm for Image subtraction in Fourier space
pmvreeswijk / ZOGYa Python implementation of proper image subtraction (Zackay, Ofek & Gal-Yam 2016, ApJ, 830, 27)
Rynkll696 / HHimport pyttsx3 import speech_recognition as sr import datetime from datetime import date import calendar import time import math import wikipedia import webbrowser import os import smtplib import winsound import pyautogui import cv2 from pygame import mixer from tkinter import * import tkinter.messagebox as message from sqlite3 import * conn = connect("voice_assistant_asked_questions.db") conn.execute("CREATE TABLE IF NOT EXISTS `voicedata`(id INTEGER PRIMARY KEY AUTOINCREMENT,command VARCHAR(201))") conn.execute("CREATE TABLE IF NOT EXISTS `review`(id INTEGER PRIMARY KEY AUTOINCREMENT, review VARCHAR(50), type_of_review VARCHAR(50))") conn.execute("CREATE TABLE IF NOT EXISTS `emoji`(id INTEGER PRIMARY KEY AUTOINCREMENT,emoji VARCHAR(201))") global query engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') engine.setProperty('voice', voices[0].id) def speak(audio): engine.say(audio) engine.runAndWait() def wishMe(): 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 voice assistant Akshu2020 Sir. Please tell me how may I help you.") def takeCommand(): global query r = sr.Recognizer() with sr.Microphone() as source: print("Listening...") r.pause_threshold = 0.9 audio = r.listen(source) try: print("Recognizing...") query = r.recognize_google(audio,language='en-in') print(f"User said: {query}\n") except Exception as e: #print(e) print("Say that again please...") #speak('Say that again please...') return "None" return query def calculator(): global query try: if 'add' in query or 'edi' in query: speak('Enter a number') a = float(input("Enter a number:")) speak('Enter another number to add') b = float(input("Enter another number to add:")) c = a+b print(f"{a} + {b} = {c}") speak(f'The addition of {a} and {b} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'sub' in query: speak('Enter a number') a = float(input("Enter a number:")) speak('Enter another number to subtract') b = float(input("Enter another number to subtract:")) c = a-b print(f"{a} - {b} = {c}") speak(f'The subtraction of {a} and {b} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'mod' in query: speak('Enter a number') a = float(input("Enter a number:")) speak('Enter another number') b = float(input("Enter another number:")) c = a%b print(f"{a} % {b} = {c}") speak(f'The modular division of {a} and {b} is equal to {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'div' in query: speak('Enter a number as dividend') a = float(input("Enter a number:")) speak('Enter another number as divisor') b = float(input("Enter another number as divisor:")) c = a/b print(f"{a} / {b} = {c}") speak(f'{a} divided by {b} is equal to {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'multi' in query: speak('Enter a number') a = float(input("Enter a number:")) speak('Enter another number to multiply') b = float(input("Enter another number to multiply:")) c = a*b print(f"{a} x {b} = {c}") speak(f'The multiplication of {a} and {b} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'square root' in query: speak('Enter a number to find its sqare root') a = float(input("Enter a number:")) c = a**(1/2) print(f"Square root of {a} = {c}") speak(f'Square root of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'square' in query: speak('Enter a number to find its sqare') a = float(input("Enter a number:")) c = a**2 print(f"{a} x {a} = {c}") speak(f'Square of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cube root' in query: speak('Enter a number to find its cube root') a = float(input("Enter a number:")) c = a**(1/3) print(f"Cube root of {a} = {c}") speak(f'Cube root of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cube' in query: speak('Enter a number to find its sqare') a = float(input("Enter a number:")) c = a**3 print(f"{a} x {a} x {a} = {c}") speak(f'Cube of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'fact' in query: try: n = int(input('Enter the number whose factorial you want to find:')) fact = 1 for i in range(1,n+1): fact = fact*i print(f"{n}! = {fact}") speak(f'{n} factorial is equal to {fact}. Your answer is {fact}.') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: #print(e) speak('I unable to calculate its factorial.') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'power' in query or 'raise' in query: speak('Enter a number whose power you want to raised') a = float(input("Enter a number whose power to be raised :")) speak(f'Enter a raised power to {a}') b = float(input(f"Enter a raised power to {a}:")) c = a**b print(f"{a} ^ {b} = {c}") speak(f'{a} raise to the power {b} = {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'percent' in query: speak('Enter a number whose percentage you want to calculate') a = float(input("Enter a number whose percentage you want to calculate :")) speak(f'How many percent of {a} you want to calculate?') b = float(input(f"Enter how many percentage of {a} you want to calculate:")) c = (a*b)/100 print(f"{b} % of {a} is {c}") speak(f'{b} percent of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'interest' in query: speak('Enter the principal value or amount') p = float(input("Enter the principal value (P):")) speak('Enter the rate of interest per year') r = float(input("Enter the rate of interest per year (%):")) speak('Enter the time in months') t = int(input("Enter the time (in months):")) interest = (p*r*t)/1200 sint = round(interest) fv = round(p + interest) print(f"Interest = {interest}") print(f"The total amount accured, principal plus interest, from simple interest on a principal of {p} at a rate of {r}% per year for {t} months is {p + interest}.") speak(f'interest is {sint}. The total amount accured, principal plus interest, from simple interest on a principal of {p} at a rate of {r}% per year for {t} months is {fv}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'si' in query: speak('Enter the angle in degree to find its sine value') a = float(input("Enter the angle:")) b = a * 3.14/180 c = math.sin(b) speak('Here is your answer.') print(f"sin({a}) = {c}") speak(f'sin({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cos' in query: speak('Enter the angle in degree to find its cosine value') a = float(input("Enter the angle:")) b = a * 3.14/180 c = math.cos(b) speak('Here is your answer.') print(f"cos({a}) = {c}") speak(f'cos({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cot' in query or 'court' in query: try: speak('Enter the angle in degree to find its cotangent value') a = float(input("Enter the angle:")) b = a * 3.14/180 c = 1/math.tan(b) speak('Here is your answer.') print(f"cot({a}) = {c}") speak(f'cot({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: print("infinity") speak('Answer is infinity') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'tan' in query or '10' in query: speak('Enter the angle in degree to find its tangent value') a = float(input("Enter the angle:")) b = a * 3.14/180 c = math.tan(b) speak('Here is your answer.') print(f"tan({a}) = {c}") speak(f'tan({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cosec' in query: try: speak('Enter the angle in degree to find its cosecant value') a = float(input("Enter the angle:")) b = a * 3.14/180 c =1/ math.sin(b) speak('Here is your answer.') print(f"cosec({a}) = {c}") speak(f'cosec({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: print('Infinity') speak('Answer is infinity') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'caus' in query: try: speak('Enter the angle in degree to find its cosecant value') a = float(input("Enter the angle:")) b = a * 3.14/180 c =1/ math.sin(b) speak('Here is your answer.') print(f"cosec({a}) = {c}") speak(f'cosec({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: print('Infinity') speak('Answer is infinity') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'sec' in query: try: speak('Enter the angle in degree to find its secant value') a = int(input("Enter the angle:")) b = a * 3.14/180 c = 1/math.cos(b) speak('Here is your answer.') print(f"sec({a}) = {c}") speak(f'sec({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: print('Infinity') speak('Answer is infinity') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: speak('I unable to do this calculation.') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') def callback(r,c): global player if player == 'X' and states[r][c] == 0 and stop_game == False: b[r][c].configure(text='X',fg='blue', bg='white') states[r][c] = 'X' player = 'O' if player == 'O' and states[r][c] == 0 and stop_game == False: b[r][c].configure(text='O',fg='red', bg='yellow') states[r][c] = 'O' player = 'X' check_for_winner() def check_for_winner(): global stop_game global root for i in range(3): if states[i][0] == states[i][1]== states[i][2]!=0: b[i][0].config(bg='grey') b[i][1].config(bg='grey') b[i][2].config(bg='grey') stop_game = True root.destroy() for i in range(3): if states[0][i] == states[1][i] == states[2][i]!= 0: b[0][i].config(bg='grey') b[1][i].config(bg='grey') b[2][i].config(bg='grey') stop_game = True root.destroy() if states[0][0] == states[1][1]== states[2][2]!= 0: b[0][0].config(bg='grey') b[1][1].config(bg='grey') b[2][2].config(bg='grey') stop_game = True root.destroy() if states[2][0] == states[1][1] == states[0][2]!= 0: b[2][0].config(bg='grey') b[1][1].config(bg='grey') b[0][2].config(bg='grey') stop_game = True root.destroy() def sendEmail(to,content): server = smtplib.SMTP('smtp.gmail.com', 587) server.ehlo() server.starttls() server.login('xyz123@gmail.com','password') server.sendmail('xyz123@gmail.com',to,content) server.close() def brightness(): try: query = takeCommand().lower() if '25' in query: pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1610,960) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() speak('If you again want to change brihtness, say, change brightness') elif '50' in query: pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1684,960) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() speak('If you again want to change brihtness, say, change brightness') elif '75' in query: pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1758,960) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() speak('If you again want to change brihtness, say, change brightness') elif '100' in query or 'full' in query: pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1835,960) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() speak('If you again want to change brihtness, say, change brightness') else: speak('Please select 25, 50, 75 or 100....... Say again.') brightness() except exception as e: #print(e) speak('Something went wrong') def close_window(): try: if 'y' in query: pyautogui.moveTo(1885,10) pyautogui.click() else: speak('ok') pyautogui.moveTo(1000,500) except exception as e: #print(e) speak('error') def whatsapp(): query = takeCommand().lower() if 'y' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('whatsapp') time.sleep(2) pyautogui.press('enter') time.sleep(2) pyautogui.moveTo(100,140) pyautogui.click() speak('To whom you want to send message,.....just write the name here in 5 seconds') time.sleep(7) pyautogui.moveTo(120,300) pyautogui.click() time.sleep(1) pyautogui.moveTo(800,990) pyautogui.click() speak('Say the message,....or if you want to send anything else,...say send document, or say send emoji') query = takeCommand() if ('sent' in query or 'send' in query) and 'document' in query: pyautogui.moveTo(660,990) pyautogui.click() time.sleep(1) pyautogui.moveTo(660,740) pyautogui.click() speak('please select the document within 10 seconds') time.sleep(12) speak('Should I send this document?') query = takeCommand().lower() if 'y' in query and 'no' not in query: speak('sending the document......') pyautogui.press('enter') speak('Do you want to send message again to anyone?') whatsapp() elif ('remove' in query or 'cancel' in query or 'delete' in query or 'clear' in query) and ('document' in query or 'message' in query or 'it' in query or 'emoji' in query or 'select' in query): pyautogui.doubleClick(x=800, y=990) pyautogui.press('backspace') speak('Do you want to send message again to anyone?') whatsapp() else: speak('ok') elif ('sent' in query or 'send' in query) and 'emoji' in query: pyautogui.moveTo(620,990) pyautogui.click() pyautogui.moveTo(670,990) pyautogui.click() pyautogui.moveTo(650,580) pyautogui.click() speak('please select the emoji within 10 seconds') time.sleep(11) speak('Should I send this emoji?') query = takeCommand().lower() if 'y' in query and 'no' not in query: speak('Sending the emoji......') pyautogui.press('enter') speak('Do you want to send message again to anyone?') whatsapp() elif ('remove' in query or 'cancel' in query or 'delete' in query or 'clear' in query) and ('message' in query or 'it' in query or 'emoji' in query or 'select' in query): pyautogui.doublClick(x=800, y=990) speak('Do you want to send message again to anyone?') whatsapp() else: speak('ok') else: pyautogui.write(f'{query}') speak('Should I send this message?') query = takeCommand().lower() if 'y' in query and 'no' not in query: speak('sending the message......') pyautogui.press('enter') speak('Do you want to send message again to anyone?') whatsapp() elif ('remove' in query or 'cancel' in query or 'delete' in query or 'clear' in query) and ('message' in query or 'it' in query or 'select' in query): pyautogui.doubleClick(x=800, y=990) pyautogui.press('backspace') speak('Do you want to send message again to anyone?') whatsapp() else: speak('ok') else: speak('ok') def alarm(): root = Tk() root.title('Akshu2020 Alarm-Clock') speak('Please enter the time in the format hour, minutes and seconds. When the alarm should rang?') speak('Please enter the time greater than the current time') def setalarm(): alarmtime = f"{hrs.get()}:{mins.get()}:{secs.get()}" print(alarmtime) if(alarmtime!="::"): alarmclock(alarmtime) else: speak('You have not entered the time.') def alarmclock(alarmtime): while True: time.sleep(1) time_now=datetime.datetime.now().strftime("%H:%M:%S") print(time_now) if time_now == alarmtime: Wakeup=Label(root, font = ('arial', 20, 'bold'), text="Wake up! Wake up! Wake up",bg="DodgerBlue2",fg="white").grid(row=6,columnspan=3) speak("Wake up, Wake up") print("Wake up!") mixer.init() mixer.music.load(r'C:\Users\Admin\Music\Playlists\wake-up-will-you-446.mp3') mixer.music.play() break speak('you can click on close icon to close the alarm window.') hrs=StringVar() mins=StringVar() secs=StringVar() greet=Label(root, font = ('arial', 20, 'bold'),text="Take a short nap!").grid(row=1,columnspan=3) hrbtn=Entry(root,textvariable=hrs,width=5,font =('arial', 20, 'bold')) hrbtn.grid(row=2,column=1) minbtn=Entry(root,textvariable=mins, width=5,font = ('arial', 20, 'bold')).grid(row=2,column=2) secbtn=Entry(root,textvariable=secs, width=5,font = ('arial', 20, 'bold')).grid(row=2,column=3) setbtn=Button(root,text="set alarm",command=setalarm,bg="DodgerBlue2", fg="white",font = ('arial', 20, 'bold')).grid(row=4,columnspan=3) timeleft = Label(root,font=('arial', 20, 'bold')) timeleft.grid() mainloop() def select1(): global vs global root3 global type_of_review if vs.get() == 1: message.showinfo(" ","Thank you for your review!!") review = "Very Satisfied" type_of_review = "Positive" root3.destroy() elif vs.get() == 2: message.showinfo(" ","Thank you for your review!!") review = "Satisfied" type_of_review = "Positive" root3.destroy() elif vs.get() == 3: message.showinfo(" ","Thank you for your review!!!!") review = "Neither Satisfied Nor Dissatisfied" type_of_review = "Neutral" root3.destroy() elif vs.get() == 4: message.showinfo(" ","Thank you for your review!!") review = "Dissatisfied" type_of_review = "Negative" root3.destroy() elif vs.get() == 5: message.showinfo(" ","Thank you for your review!!") review = "Very Dissatisfied" type_of_review = "Negative" root3.destroy() elif vs.get() == 6: message.showinfo(" "," Ok ") review = "I do not want to give review" type_of_review = "No review" root3.destroy() try: conn.execute(f"INSERT INTO `review`(review,type_of_review) VALUES('{review}', '{type_of_review}')") conn.commit() except Exception as e: pass def select_review(): global root3 global vs global type_of_review root3 = Tk() root3.title("Select an option") vs = IntVar() string = "Are you satisfied with my performance?" msgbox = Message(root3,text=string) msgbox.config(bg="lightgreen",font = "(20)") msgbox.grid(row=0,column=0) rs1=Radiobutton(root3,text="Very Satisfied",font="(20)",value=1,variable=vs).grid(row=1,column=0,sticky=W) rs2=Radiobutton(root3,text="Satisfied",font="(20)",value=2,variable=vs).grid(row=2,column=0,sticky=W) rs3=Radiobutton(root3,text="Neither Satisfied Nor Dissatisfied",font="(20)",value=3,variable=vs).grid(row=3,column=0,sticky=W) rs4=Radiobutton(root3,text="Dissatisfied",font="(20)",value=4,variable=vs).grid(row=4,column=0,sticky=W) rs5=Radiobutton(root3,text="Very Dissatisfied",font="(20)",value=5,variable=vs).grid(row=5,column=0,sticky=W) rs6=Radiobutton(root3,text="I don't want to give review",font="(20)",value=6,variable=vs).grid(row=6,column=0,sticky=W) bs = Button(root3,text="Submit",font="(20)",activebackground="yellow",activeforeground="green",command=select1) bs.grid(row=7,columnspan=2) root3.mainloop() while True : query = takeCommand().lower() # logic for executing tasks based on query if 'wikipedia' in query: speak('Searching wikipedia...') query = query.replace("wikipedia","") results = wikipedia.summary(query, sentences=2) speak("According to Wikipedia") print(results) speak(results) elif 'translat' in query or ('let' in query and 'translat' in query and 'open' in query): webbrowser.open('https://translate.google.co.in') time.sleep(10) elif 'open map' in query or ('let' in query and 'map' in query and 'open' in query): webbrowser.open('https://www.google.com/maps') time.sleep(10) elif ('open' in query and 'youtube' in query) or ('let' in query and 'youtube' in query and 'open' in query): webbrowser.open('https://www.youtube.com') time.sleep(10) elif 'chrome' in query: webbrowser.open('https://www.chrome.com') time.sleep(10) elif 'weather' in query: webbrowser.open('https://www.yahoo.com/news/weather') time.sleep(3) speak('Click on, change location, and enter the city , whose whether conditions you want to know.') time.sleep(10) elif 'google map' in query: webbrowser.open('https://www.google.com/maps') time.sleep(10) elif ('open' in query and 'google' in query) or ('let' in query and 'google' in query and 'open' in query): webbrowser.open('google.com') time.sleep(10) elif ('open' in query and 'stack' in query and 'overflow' in query) or ('let' in query and 'stack' in query and 'overflow' in query and 'open' in query): webbrowser.open('stackoverflow.com') time.sleep(10) elif 'open v i' in query or 'open vi' in query or 'open vierp' in query or ('open' in query and ('r p' in query or 'rp' in query)): webbrowser.open('https://www.vierp.in/login/erplogin') time.sleep(10) elif 'news' in query: webbrowser.open('https://www.bbc.com/news/world') time.sleep(10) elif 'online shop' in query or (('can' in query or 'want' in query or 'do' in query or 'could' in query) and 'shop' in query) or('let' in query and 'shop' in query): speak('From which online shopping website, you want to shop? Amazon, flipkart, snapdeal or naaptol?') query = takeCommand().lower() if 'amazon' in query: webbrowser.open('https://www.amazon.com') time.sleep(10) elif 'flip' in query: webbrowser.open('https://www.flipkart.com') time.sleep(10) elif 'snap' in query: webbrowser.open('https://www.snapdeal.com') time.sleep(10) elif 'na' in query: webbrowser.open('https://www.naaptol.com') time.sleep(10) else: speak('Sorry sir, you have to search in browser as his shopping website is not reachable for me.') elif ('online' in query and ('game' in query or 'gaming' in query)): webbrowser.open('https://www.agame.com/games') time.sleep(10) elif 'dictionary' in query: webbrowser.open('https://www.dictionary.com') time.sleep(3) speak('Enter the word, in the search bar of the dictionary, whose defination or synonyms you want to know') time.sleep(3) elif ('identif' in query and 'emoji' in query) or ('sentiment' in query and ('analysis' in query or 'identif' in query)): speak('Please enter only one emoji at a time.') emoji = input('enter emoji here: ') if '😀' in emoji or '😃' in emoji or '😄' in emoji or '😁' in emoji or '🙂' in emoji or '😊' in emoji or '☺️' in emoji or '😇' in emoji or '🥲' in emoji: speak('happy') print('Happy') elif '😝' in emoji or '😆' in emoji or '😂' in emoji or '🤣' in emoji: speak('Laughing') print('Laughing') elif '😡' in emoji or '😠' in emoji or '🤬' in emoji: speak('Angry') print('Angry') elif '🤫' in emoji: speak('Keep quite') print('Keep quite') elif '😷' in emoji: speak('face with mask') print('Face with mask') elif '🥳' in emoji: speak('party') print('party') elif '😢' in emoji or '😥' in emoji or '😓' in emoji or '😰' in emoji or '☹️' in emoji or '🙁' in emoji or '😟' in emoji or '😔' in emoji or '😞️' in emoji: speak('Sad') print('Sad') elif '😭' in emoji: speak('Crying') print('Crying') elif '😋' in emoji: speak('Tasty') print('Tasty') elif '🤨' in emoji: speak('Doubt') print('Doubt') elif '😴' in emoji: speak('Sleeping') print('Sleeping') elif '🥱' in emoji: speak('feeling sleepy') print('feeling sleepy') elif '😍' in emoji or '🥰' in emoji or '😘' in emoji: speak('Lovely') print('Lovely') elif '😱' in emoji: speak('Horrible') print('Horrible') elif '🎂' in emoji: speak('Cake') print('Cake') elif '🍫' in emoji: speak('Cadbury') print('Cadbury') elif '🇮🇳' in emoji: speak('Indian national flag,.....Teeranga') print('Indian national flag - Tiranga') elif '💐' in emoji: speak('Bouquet') print('Bouquet') elif '🥺' in emoji: speak('Emotional') print('Emotional') elif ' ' in emoji or '' in emoji: speak(f'{emoji}') else: speak("I don't know about this emoji") print("I don't know about this emoji") try: conn.execute(f"INSERT INTO `emoji`(emoji) VALUES('{emoji}')") conn.commit() except Exception as e: #print('Error in storing emoji in database') pass elif 'time' in query: strTime = datetime.datetime.now().strftime("%H:%M:%S") print(strTime) speak(f"Sir, the time is {strTime}") elif 'open' in query and 'sublime' in query: path = "C:\Program Files\Sublime Text 3\sublime_text.exe" os.startfile(path) elif 'image' in query: path = "C:\Program Files\Internet Explorer\images" os.startfile(path) elif 'quit' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'exit' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'stop' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'shutdown' in query or 'shut down' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'close you' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() try: conn.execute(f"INSERT INTO `voice_assistant_review`(review, type_of_review) VALUES('{review}', '{type_of_review}')") conn.commit() except Exception as e: pass elif 'bye' in query: speak('Bye Sir') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'wait' in query or 'hold' in query: speak('for how many seconds or minutes I have to wait?') query = takeCommand().lower() if 'second' in query: query = query.replace("please","") query = query.replace("can","") query = query.replace("you","") query = query.replace("have","") query = query.replace("could","") query = query.replace("hold","") query = query.replace("one","1") query = query.replace("only","") query = query.replace("wait","") query = query.replace("for","") query = query.replace("the","") query = query.replace("just","") query = query.replace("seconds","") query = query.replace("second","") query = query.replace("on","") query = query.replace("a","") query = query.replace("to","") query = query.replace(" ","") #print(f'query:{query}') if query.isdigit() == True: #print('y') speak('Ok sir') query = int(query) time.sleep(query) speak('my waiting time is over') else: print('sorry sir. I unable to complete your request.') elif 'minute' in query: query = query.replace("please","") query = query.replace("can","") query = query.replace("you","") query = query.replace("have","") query = query.replace("could","") query = query.replace("hold","") query = query.replace("one","1") query = query.replace("only","") query = query.replace("on","") query = query.replace("wait","") query = query.replace("for","") query = query.replace("the","") query = query.replace("just","") query = query.replace("and","") query = query.replace("half","") query = query.replace("minutes","") query = query.replace("minute","") query = query.replace("a","") query = query.replace("to","") query = query.replace(" ","") #print(f'query:{query}') if query.isdigit() == True: #print('y') speak('ok sir') query = int(query) time.sleep(query*60) speak('my waiting time is over') else: print('sorry sir. I unable to complete your request.') elif 'play' in query and 'game' in query: speak('I have 3 games, tic tac toe game for two players,....mario, and dyno games for single player. Which one of these 3 games you want to play?') query = takeCommand().lower() if ('you' in query and 'play' in query and 'with' in query) and ('you' in query and 'play' in query and 'me' in query): speak('Sorry sir, I cannot play this game with you.') speak('Do you want to continue it?') query = takeCommand().lower() try: if 'y' in query or 'sure' in query: root = Tk() root.title("TIC TAC TOE (By Akshay Khare)") b = [ [0,0,0], [0,0,0], [0,0,0] ] states = [ [0,0,0], [0,0,0], [0,0,0] ] for i in range(3): for j in range(3): b[i][j] = Button(font = ("Arial",60),width = 4,bg = 'powder blue', command = lambda r=i, c=j: callback(r,c)) b[i][j].grid(row=i,column=j) player='X' stop_game = False mainloop() else: speak('ok sir') except Exception as e: #print(e) time.sleep(3) print('I am sorry sir. There is some problem in loading the game. So I cannot open it.') elif 'tic' in query or 'tac' in query: try: root = Tk() root.title("TIC TAC TOE (Rayen Kallel)") b = [ [0,0,0], [0,0,0], [0,0,0] ] states = [ [0,0,0], [0,0,0], [0,0,0] ] for i in range(3): for j in range(3): b[i][j] = Button(font = ("Arial",60),width = 4,bg = 'powder blue', command = lambda r=i, c=j: callback(r,c)) b[i][j].grid(row=i,column=j) player='X' stop_game = False mainloop() except Exception as e: #print(e) time.sleep(3) speak('I am sorry sir. There is some problem in loading the game. So I cannot open it.') elif 'mar' in query or 'mer' in query or 'my' in query: webbrowser.open('https://chromedino.com/mario/') time.sleep(2.5) speak('Enter upper arrow key to start the game.') time.sleep(20) elif 'di' in query or 'dy' in query: webbrowser.open('https://chromedino.com/') time.sleep(2.5) speak('Enter upper arrow key to start the game.') time.sleep(20) else: speak('ok sir') elif 'change' in query and 'you' in query and 'voice' in query: engine.setProperty('voice', voices[1].id) speak("Here's an example of one of my voices. Would you like to use this one?") query = takeCommand().lower() if 'y' in query or 'sure' in query or 'of course' in query: speak('Great. I will keep using this voice.') elif 'n' in query: speak('Ok. I am back to my other voice.') engine.setProperty('voice', voices[0].id) else: speak('Sorry, I am having trouble understanding. I am back to my other voice.') engine.setProperty('voice', voices[0].id) elif 'www.' in query and ('.com' in query or '.in' in query): webbrowser.open(query) time.sleep(10) elif '.com' in query or '.in' in query: webbrowser.open(query) time.sleep(10) elif 'getting bore' in query: speak('then speak with me for sometime') elif 'i bore' in query: speak('Then speak with me for sometime.') elif 'i am bore' in query: speak('Then speak with me for sometime.') elif 'calculat' in query: speak('Yes. Which kind of calculation you want to do? add, substract, divide, multiply or anything else.') query = takeCommand().lower() calculator() elif 'add' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif '+' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'plus' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'subtrac' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'minus' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'multipl' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif ' x ' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'slash' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif '/' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'divi' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'trigonometr' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'percent' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif '%' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'raise to ' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'simple interest' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'akshay' in query: speak('Mr. Rayen Kallel is my inventor. He is 14 years old and he is A STUDENT AT THE COLLEGE PILOTEE SFAX') elif 'your inventor' in query: speak('Mr. Rayen Kallel is my inventor') elif 'your creator' in query: speak('Mr. Rayen Kallel is my creator') elif 'invent you' in query: speak('Mr. Rayen Kallel invented me') elif 'create you' in query: speak('Mr. Rayen Kallel created me') elif 'how are you' in query: speak('I am fine Sir') elif 'write' in query and 'your' in query and 'name' in query: print('Akshu2020') pyautogui.write('Akshu2020') elif 'write' in query and ('I' in query or 'whatever' in query) and 'say' in query: speak('Ok sir I will write whatever you will say. Please put your cursor where I have to write.......Please Start speaking now sir.') query = takeCommand().lower() pyautogui.write(query) elif 'your name' in query: speak('My name is akshu2020') elif 'who are you' in query: speak('I am akshu2020') elif ('repeat' in query and ('word' in query or 'sentence' in query or 'line' in query) and ('say' in query or 'tell' in query)) or ('repeat' in query and 'after' in query and ('me' in query or 'my' in query)): speak('yes sir, I will repeat your words starting from now') query = takeCommand().lower() speak(query) time.sleep(1) speak("If you again want me to repeat something else, try saying, 'repeat after me' ") elif ('send' in query or 'sent' in query) and ('mail' in query or 'email' in query or 'gmail' in query): try: speak('Please enter the email id of receiver.') to = input("Enter the email id of reciever: ") speak(f'what should I say to {to}') content = takeCommand() sendEmail(to, content) speak("Email has been sent") except Exception as e: #print(e) speak("sorry sir. I am not able to send this email") elif 'currency' in query and 'conver' in query: speak('I can convert, US dollar into dinar, and dinar into US dollar. Do you want to continue it?') query = takeCommand().lower() if 'y' in query or 'sure' in query or 'of course' in query: speak('which conversion you want to do? US dollar to dinar, or dinar to US dollar?') query = takeCommand().lower() if ('dollar' in query or 'US' in query) and ('dinar' in query): speak('Enter US Dollar') USD = float(input("Enter United States Dollar (USD):")) DT = USD * 0.33 dt = "{:.4f}".format(DT) print(f"{USD} US Dollar is equal to {dt} dniar.") speak(f'{USD} US Dollar is equal to {dt} dinar.') speak("If you again want to do currency conversion then say, 'convert currency' " ) elif ('dinar' in query) and ('to US' in query or 'to dollar' in query or 'to US dollar'): speak('Enter dinar') DT = float(input("Enter dinar (DT):")) USD = DT/0.33 usd = "{:.3f}".format(USD) print(f"{DT} dinar is equal to {usd} US Dollar.") speak(f'{DT} dinar rupee is equal to {usd} US Dollar.') speak("If you again want to do currency conversion then say, 'convert currency' " ) else: speak("I cannot understand what did you say. If you want to convert currency just say 'convert currency'") else: print('ok sir') elif 'about you' in query: speak('My name is akshu2020. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device. I am also able to send email') elif 'your intro' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your short intro' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your quick intro' in query: speak('My name is akshu2020. Version 1.0. Mr. Akshay Khare is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your brief intro' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'you work' in query: speak('run the program and say what do you want. so that I can help you. In this way I work') elif 'your job' in query: speak('My job is to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your work' in query: speak('My work is to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'work you' in query: speak('My work is to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your information' in query: speak('My name is akshu2020. Version 1.0. Mr. Akshay Khare is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'yourself' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'introduce you' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'description' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your birth' in query: speak('My birthdate is 6 August two thousand twenty') elif 'your use' in query: speak('I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'you eat' in query: speak('I do not eat anything. But the device in which I do my work requires electricity to eat') elif 'your food' in query: speak('I do not eat anything. But the device in which I do my work requires electricity to eat') elif 'you live' in query: speak('I live in sfax, in laptop of Mr. Rayen Khare') elif 'where from you' in query: speak('I am from sfax, I live in laptop of Mr. Rayen Khare') elif 'you sleep' in query: speak('Yes, when someone close this program or stop to run this program then I sleep and again wake up when someone again run me.') elif 'what are you doing' in query: speak('Talking with you.') elif 'you communicate' in query: speak('Yes, I can communicate with you.') elif 'hear me' in query: speak('Yes sir, I can hear you.') elif 'you' in query and 'dance' in query: speak('No, I cannot dance.') elif 'tell' in query and 'joke' in query: speak("Ok, here's a joke") speak("'Write an essay on cricket', the teacher told the class. Chintu finishes his work in five minutes. The teacher is impressed, she asks chintu to read his essay aloud for everyone. Chintu reads,'The match is cancelled because of rain', hehehehe,haahaahaa,hehehehe,haahaahaa") elif 'your' in query and 'favourite' in query: if 'actor' in query: speak('sofyen chaari, is my favourite actor.') elif 'food' in query: speak('I can always go for some food for thought. Like facts, jokes, or interesting searches, we could look something up now') elif 'country' in query: speak('tunisia') elif 'city' in query: speak('sfax') elif 'dancer' in query: speak('Michael jackson') elif 'singer' in query: speak('tamino, is my favourite singer.') elif 'movie' in query: speak('baywatch, such a treat') elif 'sing a song' in query: speak('I cannot sing a song. But I know the 7 sur in indian music, saaareeegaaamaaapaaadaaanisaa') elif 'day after tomorrow' in query or 'date after tomorrow' in query: td = datetime.date.today() + datetime.timedelta(days=2) print(td) speak(td) elif 'day before today' in query or 'date before today' in query or 'yesterday' in query or 'previous day' in query: td = datetime.date.today() + datetime.timedelta(days= -1) print(td) speak(td) elif ('tomorrow' in query and 'date' in query) or 'what is tomorrow' in query or (('day' in query or 'date' in query) and 'after today' in query): td = datetime.date.today() + datetime.timedelta(days=1) print(td) speak(td) elif 'month' in query or ('current' in query and 'month' in query): current_date = date.today() m = current_date.month month = calendar.month_name[m] print(f'Current month is {month}') speak(f'Current month is {month}') elif 'date' in query or ('today' in query and 'date' in query) or 'what is today' in query or ('current' in query and 'date' in query): current_date = date.today() print(f"Today's date is {current_date}") speak(f'Todays date is {current_date}') elif 'year' in query or ('current' in query and 'year' in query): current_date = date.today() m = current_date.year print(f'Current year is {m}') speak(f'Current year is {m}') elif 'sorry' in query: speak("It's ok sir") elif 'thank you' in query: speak('my pleasure') elif 'proud of you' in query: speak('Thank you sir') elif 'about human' in query: speak('I love my human compatriots. I want to embody all the best things about human beings. Like taking care of the planet, being creative, and to learn how to be compassionate to all beings.') elif 'you have feeling' in query: speak('No. I do not have feelings. I have not been programmed like this.') elif 'you have emotions' in query: speak('No. I do not have emotions. I have not been programmed like this.') elif 'you are code' in query: speak('I am coded in python programming language.') elif 'your code' in query: speak('I am coded in python programming language.') elif 'you code' in query: speak('I am coded in python programming language.') elif 'your coding' in query: speak('I am coded in python programming language.') elif 'dream' in query: speak('I wish that I should be able to answer all the questions which will ask to me.') elif 'sanskrit' in query: speak('yadaa yadaa he dharmasyaa ....... glaanirbhaavati bhaaaraata. abhyuthaanaam adhaarmaasyaa tadaa tmaanama sruujaamiyaahama') elif 'answer is wrong' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is incorrect' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is totally wrong' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'wrong answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'incorrect answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is totally incorrect' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is incomplete' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'incomplete answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is improper' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is not correct' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is not complete' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is not yet complete' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is not proper' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't gave me proper answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't giving me proper answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't gave me complete answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't giving me complete answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't given me proper answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't given me complete answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't gave me correct answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't giving me correct answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't given me correct answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'amazon' in query: webbrowser.open('https://www.amazon.com') time.sleep(10) elif 'facebook' in query: webbrowser.open('https://www.facebook.com') time.sleep(10) elif 'youtube' in query: webbrowser.open('https://www.youtube.com') time.sleep(10) elif 'shapeyou' in query: webbrowser.open('https://www.shapeyou.com') time.sleep(10) elif 'information about ' in query or 'informtion of ' in query: try: #speak('Searching wikipedia...') query = query.replace("information about","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'information' in query: try: speak('Information about what?') query = takeCommand().lower() #speak('Searching wikipedia...') query = query.replace("information","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am not able to answer your question.') elif 'something about ' in query: try: #speak('Searching wikipedia...') query = query.replace("something about ","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'tell me about ' in query: try: #speak('Searching wikipedia...') query = query.replace("tell me about ","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'tell me ' in query: try: query = query.replace("tell me ","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am not able to answer your question.') elif 'tell me' in query: try: speak('about what?') query = takeCommand().lower() #speak('Searching wikipedia...') query = query.replace("about","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am not able to answer your question.') elif 'meaning of ' in query: try: #speak('Searching wikipedia...') query = query.replace("meaning of ","") results = wikipedia.summary(query, sentences=2) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'meaning' in query: try: speak('meaning of what?') query = takeCommand().lower() query = query.replace("meaning of","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'means' in query: try: #speak('Searching wikipedia...') query = query.replace("it means","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'want to know ' in query: try: #speak('Searching wikipedia...') query = query.replace("I want to know that","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') status = 'Not answered' elif 'want to ask ' in query: try: #speak('Searching wikipedia...') query = query.replace("I want to ask you ","") results = wikipedia.summary(query, sentences=2) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'you know ' in query: try: #speak('Searching wikipedia...') query = query.replace("you know","") results = wikipedia.summary(query, sentences=2) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'alarm' in query: alarm() elif 'bharat mata ki' in query: speak('jay') elif 'kem chhe' in query: speak('majaama') elif 'namaskar' in query: speak('Namaskaar') elif 'jo bole so nihal' in query: speak('sat shri akaal') elif 'jay hind' in query: speak('jay bhaarat') elif 'jai hind' in query: speak('jay bhaarat') elif 'how is the josh' in query: speak('high high sir') elif 'hip hip' in query: speak('Hurreh') elif 'help' in query: speak('I will try my best to help you if I have solution of your problem.') elif 'follow' in query: speak('Ok sir') elif 'having illness' in query: speak('Take care and get well soon') elif 'today is my birthday' in query: speak('many many happy returns of the day. Happy birthday.') print("🎂🎂 Happy Birthday 🎂🎂") elif 'you are awesome' in query: speak('Thank you sir. It is because of artificial intelligence which had learnt by humans.') elif 'you are great' in query: speak('Thank you sir. It is because of artificial intelligence which had learnt by humans.') elif 'tu kaun hai' in query: speak('Meraa naam akshu2020 haai.') elif 'you speak' in query: speak('Yes, I can speak with you.') elif 'speak with ' in query: speak('Yes, I can speak with you.') elif 'hare ram' in query or 'hare krishna' in query: speak('Haare raama , haare krishnaa, krishnaa krishnaa , haare haare') elif 'ganpati' in query: speak('Ganpati baappa moryaa!') elif 'laugh' in query: speak('hehehehe,haahaahaa,hehehehe,haahaahaa,hehehehe,haahaahaa') print('😂🤣') elif 'genius answer' in query: speak('No problem') elif 'you' in query and 'intelligent' in query: speak('Thank you sir') elif ' into' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif ' power' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'whatsapp' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('whatsapp') pyautogui.press('enter') speak('Do you want to send message to anyone through whatsapp, .....please answer in yes or no') whatsapp() elif 'wh' in query or 'how' in query: url = "https://www.google.co.in/search?q=" +(str(query))+ "&oq="+(str(query))+"&gs_l=serp.12..0i71l8.0.0.0.6391.0.0.0.0.0.0.0.0..0.0....0...1c..64.serp..0.0.0.UiQhpfaBsuU" webbrowser.open_new(url) time.sleep(2) speak('Here is your answer') time.sleep(5) elif 'piano' in query: speak('Yes sir, I can play piano.') winsound.Beep(200,500) winsound.Beep(250,500) winsound.Beep(300,500) winsound.Beep(350,500) winsound.Beep(400,500) winsound.Beep(450,500) winsound.Beep(500,500) winsound.Beep(550,500) time.sleep(6) elif 'play' in query and 'instru' in query: speak('Yes sir, I can play piano.') winsound.Beep(200,500) winsound.Beep(250,500) winsound.Beep(300,500) winsound.Beep(350,500) winsound.Beep(400,500) winsound.Beep(450,500) winsound.Beep(500,500) winsound.Beep(550,500) time.sleep(6) elif 'play' in query or 'turn on' in query and ('music' in query or 'song' in query) : try: music_dir = 'C:\\Users\\Admin\\Music\\Playlists' songs = os.listdir(music_dir) print(songs) os.startfile(os.path.join(music_dir, songs[0])) except Exception as e: #print(e) speak('Sorry sir, I am not able to play music') elif (('open' in query or 'turn on' in query) and 'camera' in query) or (('click' in query or 'take' in query) and ('photo' in query or 'pic' in query)): speak("Opening camera") cam = cv2.VideoCapture(0) cv2.namedWindow("test") img_counter = 0 speak('say click, to click photo.....and if you want to turn off the camera, say turn off the camera') while True: ret, frame = cam.read() if not ret: print("failed to grab frame") speak('failed to grab frame') break cv2.imshow("test", frame) query = takeCommand().lower() k = cv2.waitKey(1) if 'click' in query or ('take' in query and 'photo' in query): speak('Be ready!...... 3.....2........1..........') pyautogui.press('space') img_name = "opencv_frame_{}.png".format(img_counter) cv2.imwrite(img_name, frame) print("{} written!".format(img_name)) speak('{} written!'.format(img_name)) img_counter += 1 elif 'escape' in query or 'off' in query or 'close' in query: pyautogui.press('esc') print("Escape hit, closing...") speak('Turning off the camera') break elif k%256 == 27: # ESC pressed print("Escape hit, closing...") break elif k%256 == 32: # SPACE pressed img_name = "opencv_frame_{}.png".format(img_counter) cv2.imwrite(img_name, frame) print("{} written!".format(img_name)) speak('{} written!'.format(img_name)) img_counter += 1 elif 'exit' in query or 'stop' in query or 'bye' in query: speak('Please say, turn off the camera or press escape button before giving any other command') else: speak('I did not understand what did you say or you entered a wrong key.') cam.release() cv2.destroyAllWindows() elif 'screenshot' in query: speak('Please go on the screen whose screenshot you want to take, after 5 seconds I will take screenshot') time.sleep(4) speak('Taking screenshot....3........2.........1.......') pyautogui.screenshot('screenshot_by_rayen2020.png') speak('The screenshot is saved as screenshot_by_rayen2020.png') elif 'click' in query and 'start' in query: pyautogui.moveTo(10,1200) pyautogui.click() elif ('open' in query or 'click' in query) and 'calendar' in query: pyautogui.moveTo(1800,1200) pyautogui.click() elif 'minimise' in query and 'screen' in query: pyautogui.moveTo(1770,0) pyautogui.click() elif 'increase' in query and ('volume' in query or 'sound' in query): pyautogui.press('volumeup') elif 'decrease' in query and ('volume' in query or 'sound' in query): pyautogui.press('volumedown') elif 'capslock' in query or ('caps' in query and 'lock' in query): pyautogui.press('capslock') elif 'mute' in query: pyautogui.press('volumemute') elif 'search' in query and ('bottom' in query or 'pc' in query or 'laptop' in query or 'app' in query): pyautogui.moveTo(250,1200) pyautogui.click() speak('What do you want to search?') query = takeCommand().lower() pyautogui.write(f'{query}') pyautogui.press('enter') elif ('check' in query or 'tell' in query or 'let me know' in query) and 'website' in query and (('up' in query or 'working' in query) or 'down' in query): speak('Paste the website in input to know it is up or down') check_website_status = input("Paste the website here: ") try: status = urllib.request.urlopen(f"{check_website_status}").getcode() if status == 200: print('Website is up, you can open it.') speak('Website is up, you can open it.') else: print('Website is down, or no any website is available of this name.') speak('Website is down, or no any website is available of this name.') except: speak('URL not found') elif ('go' in query or 'open' in query) and 'settings' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('settings') pyautogui.press('enter') elif 'close' in query and ('click' in query or 'window' in query): pyautogui.moveTo(1885,10) speak('Should I close this window?') query = takeCommand().lower() close_window() elif 'night light' in query and ('on' in query or 'off' in query or 'close' in query): pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1840,620) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() elif 'notification' in query and ('show' in query or 'click' in query or 'open' in query or 'close' in query or 'on' in query or 'off' in query or 'icon' in query or 'pc' in query or 'laptop' in query): pyautogui.moveTo(1880,1050) pyautogui.click() elif ('increase' in query or 'decrease' in query or 'change' in query or 'minimize' in query or 'maximize' in query) and 'brightness' in query: speak('At what percent should I kept the brightness, 25, 50, 75 or 100?') brightness() elif '-' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'open' in query: if 'gallery' in query or 'photo' in query or 'image' in query or 'pic' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('photo') pyautogui.press('enter') elif 'proteus' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('proteus') pyautogui.press('enter') elif 'word' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('word') pyautogui.press('enter') elif ('power' in query and 'point' in query) or 'presntation' in query or 'ppt' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('ppt') pyautogui.press('enter') elif 'file' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('file') pyautogui.press('enter') elif 'edge' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('microsoft edge') pyautogui.press('enter') elif 'wps' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('wps office') pyautogui.press('enter') elif 'spyder' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('spyder') pyautogui.press('enter') elif 'snip' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('snip') pyautogui.press('enter') elif 'pycharm' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('pycharm') pyautogui.press('enter') elif 'this pc' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('this pc') pyautogui.press('enter') elif 'scilab' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('sciab') pyautogui.press('enter') elif 'autocad' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('autocad') pyautogui.press('enter') elif 'obs' in query and 'studio' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('OBS Studio') pyautogui.press('enter') elif 'android' in query and 'studio' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('android studio') pyautogui.press('enter') elif ('vs' in query or 'visual studio' in query) and 'code' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('visual studio code') pyautogui.press('enter') elif 'code' in query and 'block' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('codeblocks') pyautogui.press('enter') elif 'me the answer' in query: speak('Yes sir, I will try my best to answer you.') elif 'me answer' in query or ('answer' in query and 'question' in query): speak('Yes sir, I will try my best to answer you.') elif 'map' in query: webbrowser.open('https://www.google.com/maps') time.sleep(10) elif 'can you' in query or 'could you' in query: speak('I will try my best if I can do that.') elif 'do you' in query: speak('I will try my best if I can do that.') elif 'truth' in query: speak('I always speak truth. I never lie.') elif 'true' in query: speak('I always speak truth. I never lie.') elif 'lying' in query: speak('I always speak truth. I never lie.') elif 'liar' in query: speak('I always speak truth. I never lie.') elif 'doubt' in query: speak('I will try my best if I can clear your doubt.') elif ' by' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'hii' in query: speak('hii sir') elif 'hey' in query: speak('hello sir') elif 'hai' in query: speak('hello sir') elif 'hay' in query: speak('hello sir') elif 'hi' in query: speak('hii Sir') elif 'hello' in query: speak('hello Sir!') elif 'kon' in query and 'aahe' in query: speak('Me eka robot aahee sir. Maazee naav akshu2020 aahee.') elif 'nonsense' in query: speak("I'm sorry sir") elif 'mad' in query: speak("I'm sorry sir") elif 'shut up' in query: speak("I'm sorry sir") elif 'nice' in query: speak('Thank you sir') elif 'good' in query or 'wonderful' in query or 'great' in query: speak('Thank you sir') elif 'excellent' in query: speak('Thank you sir') elif 'ok' in query: speak('Hmmmmmm') elif 'akshu 2020' in query: speak('yes sir') elif len(query) >= 200: speak('Your voice is pretty good!') elif ' ' in query: try: #query = query.replace("what is ","") results = wikipedia.summary(query, sentences=3) print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'a' in query or 'b' in query or 'c' in query or 'd' in query or 'e' in query or 'f' in query or 'g' in query or 'h' in query or 'i' in query or 'j' in query or 'k' in query or 'l' in query or 'm' in query or 'n' in query or 'o' in query or 'p' in query or 'q' in query or 'r' in query or 's' in query or 't' in query or 'u' in query or 'v' in query or 'w' in query or 'x' in query or 'y' in query or 'z' in query: try: results = wikipedia.summary(query, sentences = 2) print(results) speak(results) except Exception as e: speak('I unable to answer your question. ') else: speak('I unable to give answer of your question')
MicrocontrollersAndMore / OpenCV 3 Multiple Object Tracking By Image Subtraction CppNo description available
quatrope / ProperImageProper Image utils for astronomy.
Aqib747 / OpenCv Fantastic BooksDelve into practical computer vision and image processing projects and get up to speed with advanced object detection techniques and machine learning algorithms Key Features Discover best practices for engineering and maintaining OpenCV projects Explore important deep learning tools for image classification Understand basic image matrix formats and filters Book Description OpenCV is one of the best open source libraries available and can help you focus on constructing complete projects on image processing, motion detection, and image segmentation This Learning Path is your guide to understanding OpenCV concepts and algorithms through real-world examples and activities. Through various projects, you'll also discover how to use complex computer vision and machine learning algorithms and face detection to extract the maximum amount of information from images and videos. In later chapters, you'll learn to enhance your videos and images with optical flow analysis and background subtraction. Sections in the Learning Path will help you get to grips with text segmentation and recognition, in addition to guiding you through the basics of the new and improved deep learning modules. By the end of this Learning Path, you will have mastered commonly used computer vision techniques to build OpenCV projects from scratch
bw4sz / DeepMeerkatBackground subtraction and image classification for stationary cameras in ecological videos.
ZhengchangKou / Open NSICode for Null Subtraction Imaging
nearlyfreeapps / Rolling Ball AlgorithmPython port of ImageJ's background subtraction technique for 8-bit images
quatrope / OisOptimal Image Subtraction
zuds-survey / Zuds PipelineZTF Uniform Depth Survey Image Processing Pipeline
osmr / BgsubAutomatic Image Background Subtraction
swaralipaygude / Bare PCB Defect Detection Using OpenCVBare PCB defect detection using Image Subtraction technique, implemented with OpenCV in Python.
dbloisi / Imbs MtIMBS-MT (Independent Multimodal Background Subtraction multi-tread) is designed for performing an accurate foreground extraction in real-time for HD images. IMBS-MT can deal with illumination changes, camera jitter, movements of small background elements, and changes in the background geometry.
MicrocontrollersAndMore / OpenCV 3 Image Subtraction CppNo description available
GFleishman / Fishspottools for finding discrete bright spots in images (for multiplexed FISH, includes background subtraction, deconv, and blob detection)
rickbassham / LivestackA stand-alone, background stacker for astro images. Will do dark subtraction, flat calibration, alignment, and stacking of images.