My Other Social Platforms
Search This Blog
Monday, 29 November 2021
Comments in Python
Python PIP Package Manager
Python Package Manager (pip):
pip is a package-management system written in Python used to install and manage software packages. It connects to an online repository of public packages, called the Python Package Index. ... Python 2.7. 9 and later (on the python2 series), and Python 3.4 and later include pip (pip3 for Python 3) by default.
Command-line interface
One major advantage of pip is the ease of its command-line interface, which makes installing Python software packages as easy as issuing a command:
pip install some-package-name
Users can also easily remove the package:
pip uninstall some-package-name
Most importantly, pip has a feature to manage full lists of packages and corresponding version numbers, possible through a "requirements" file. This permits the efficient re-creation of an entire group of packages in a separate environment (e.g. another computer) or virtual environment. This can be achieved with a properly formatted file and the following command, where requirements.txt
is the name of the file:
pip install -r requirements.txt
To install some package for a specific python version, pip provides the following command, where ${version}
is replaced by 2, 3, 3.4, etc.:
pip${version} install some-package-name
Using setup.py
Pip provides a way to install user-defined projects locally with the use of setup.py file. This method requires the python project to have the following file structure:
example_project/ ├── exampleproject/ Python package with source code. | ├── __init__.py Make the folder a package. | └── example.py Example module. └── README.md README with info of the project.
Within this structure, user can add setup.py to the root of the project (i.e. example_project
for above structure) with the following content:
from setuptools import setup, find_packages
setup(
name='example', # Name of the package. This will be used, when the project is imported as a package.
version='0.1.0',
packages=find_packages(include=['exampleproject', 'exampleproject.*']) # Pip will automatically install the dependences provided here.
)
After this, pip can install this custom project by running the following command, from the project root directory:
pip install -e .
Python Modules
Modules:
Saturday, 20 November 2021
Write a Python program to test whether a passed letter is a vowel or not.
def is_vowel(char): all_vowels = 'aeiou' return char in all_vowels print(is_vowel('c')) print(is_vowel('e'))
Output:
True
False
Write a Python program to find whether a given number (accept from the user) is even or odd, print out an appropriate message to the user
Write a Python program to calculate number of days between two dates.
INTRODUCTION
The function returns date object with same year, month and day. All arguments are required. Arguments may be integers, in the following ranges:
- MINYEAR <= year <= MAXYEAR
- 1 <= month <= 12
- 1 <= day <= number of days in the given month and year
If an argument outside those ranges is given, ValueError is raised.
- Note: The smallest year number allowed in a date or datetime object. MINYEAR is 1.
- The largest year number allowed in a date or datetime object. MAXYEAR is 9999.
Friday, 19 November 2021
Object tracking with OpenCV Python
Contents:
Introduction to the Project:
Object tracking is an application of deep learning where the program takes an initial set of object detections and develops a unique identification for each of the initial detections and then tracks the detected objects as they move around frames in a video.
In other words, object tracking is the task of automatically identifying objects in a video and interpreting them as a set of trajectories with high accuracy
Uses of Object Tracking:
Object tracking is used for a variety of use cases involving different types of input footage. Whether or not the anticipated input will be an image or a video, or a real-time video vs. a prerecorded video, impacts the algorithms used for creating object tracking applications.
The kind of input also impacts the category, use cases, and applications of object tracking. Here, we will briefly describe a few popular uses and types of object tracking, such as video tracking, visual tracking, and image tracking
Tools and Softwares needer:
1) Python 3.x
2) OpenCV-Python
Hardware requirements: Camera
MAIN PROGRAM:
Tutorial:
Making your own haarcascade OpenCV Python
What are Haarcascades?
- Positive images – These images contain the images which we want our classifier to identify.
- Negative Images – Images of everything else, which do not contain the object we want to detect.
Requirements:
Thursday, 18 November 2021
Read a text file and display the number of vowels/consonants/uppercase/lowercase ,characters in the file
Read a text file and display the number of vowels/consonants/uppercase/lowercase, characters in the file
Python program to create a CSV file named “students.csv” to store Roll , name and percentage of students
Python program to create a CSV file named “students.csv” to store Roll , name and percentage of students
program to pass a string to a function. Return and print reverse of it
Write a program to pass a string to a function.return and print reverse of it
python program to pass a string to the Function. Return and display the longest word
Write a python program to pass a string to the function .Return and display the longest word
program to take input for a number calculate and display its factorial
Write a program to take input for a number calculate and display its factorial.
Mask Detection for COVID-19 disease
Contents:
1) Introduction of the Project
2) Functions and Module used:
cv2.VideoCapture(0):
cv2.CascadeClassifier(“Haarcascade.xml”):
cv2.read():
detectMultiScale():
cv2.imshow():
3) Software/Hardware Requirements to run the Program:
Files for Downloading:
4) Main Program:
Tutorial:
how to implement YOLOv3 using Python and TensorFlow
Object Detection with YOLOv3 Introduction YOLOv3 (You Only Look Once version 3) is a real-time object detection algorithm that can detect ob...
-
Read a text file and display the number of vowels/consonants/uppercase/lowercase, characters in the file f= open ( "poem.txt" , ...
-
So hello guys, This blog will guide you how to make a Brute Force program in Python. Brute Force means Trying one by one each and every cha...
-
What are Haarcascades? Haar Cascade classifiers are an effective way for object detection. Haar Cascade is a machine learning-based approac...