Posts

Showing posts from June, 2021

basic command in UBUNTU

 $ls - list $cd - change directry $cd .. - back directry $cd - onlt go/back to home $clear - clear terminal $mkdir - make directry $rmdir - remove directry $rm - remove file

Models and capabilities of computer vision

Image
Models and capabilities of computer vision. Machine learning models can be applied to visual input from cameras, movies, or photos in most computer vision solutions. Image classification Image classification involves training a machine learning model to classify images based on their contents. For example, in a traffic monitoring solution, you might use an image classification model to classify images based on the type of vehicle they contain, such as taxis, buses, cyclists, and so on. Object detection Machine learning models for object detection are taught to classify individual objects in a picture and determine their location using a bounding box. A traffic monitoring solution, for example, might use object detection to locate different types of vehicles. Semantic segmentation Individual pixels in an image are categorised according to the entity to which they belong using semantic segmentation, a sophisticated machine learning technique. For example, a traffic monitoring solution mi...

TensorFlow Train/test /evaluation flow

Image
 TensorFlow  Train/test /evaluation flow step1: Choose a model First, we'll need to choose which machine learning algorithm we want to use to build our model. we can pick any standard machine learning algorithm but in this section, we will be using neural networks. then we can start with the training phase. step2: we train the algorithm by showing its training data and the expected output for the data and it has to figure out how to come up with the expected result. in other words, the algorithm learns how to transform the input to produce the correct output. for example, we can train it to do multiplication by showing it two numbers and the expected result and it will eventually work out that we want to multiply the two numbers. After we train the model, we will load up the second set of data, which has never seen before called the testing data set. This is the test phase, we will feed this testing data through the model and make sure it is able to predict the correct result ...

TensorFlow requirements

Image
TensorFlow requirements Development phase: - when you are coding and training a neural network. Runtime(or inference) phase: - when you are making predictions with a trained neural network. Development phase requirements: - windows, macOS, or Linux can use multiple Linux computer(locally or in the cloud ) for very large projects. Runtime phase supports:- computers running Windows, macOS or Linux.Linux servers running TensorFlow serving. google's cloud machine learning engine service. IOS or Android mobile apps. GPU acceleration Tensorflow can take advantage of NVIDIA-brand GPUs. GPUs can greatly decrease neural network training times for large neural networks. Using a GPU with TensorFlow requires installing additional software from NVIDIA(CUDA and cuDNN). Programming language support TensorFlow's core execution is written in c++ for speed. Python is the best supported and easiest language to use with TensorFlow. Supervised learning The branch of machine learning where the compu...

Flutter Basic Commands

Flutter Basic Commands  To create New PRoject (no space for project name) - flutter create project name check connected device - flutter devices clear cache - flutter clean Run flutter Project - flutter run to Run on all connected device - flutter run -d all To generate APK - flutter build apk

Important Widgets in Flutter

Image
 Important Widgets in Flutter MaterialApp() - Root widget of all material widgets Scaffold() - Every single page is called Scaffold Container() - It's empty box, used to ho;d widgets ,add space in and around Buttons - TextButton(),ElevatedButton() , OutlineButton()  Text() - Used for displaying image Image.network(), Image.asset() , CircleAvatar() -   For displaying image Row() . Column() - Alignment

Flutter widget

Image
There are two types of widget Single child widget - can hold only one child widget multi-child widget - can hold multiple child widgets  STATELESS widget is used for displaying STATIC Content or design once Data/UI is rendered, we cannot modify Data. STATEFUL widget is used for displaying DYNAMIC content or Design The stateful widget will re-render UI based on an event(Variable update, values changed , network request) Example for Flutter widget Text() - used for displaying text Image.network() -   used for displaying image Drawer() - used for displaying side menu Button -  TextButton()  EvevetedButton() FloatingButton() OutlineButton()  

what is an object in java?

Image
 what is an object in java? well, an object is like a capsule that contains data and behavior. Objects are instances of classes and a class is like a template, like a blank form in which objects are created. let's imagine an example of the class wizard. an object or an instance of that class might be Gandalf. you can take the template class wizard. then fill in its data, and then you get the object Gandalf. Now Gandalf is an instance of the class wizard, where the properties or member variables have been filled in specific to him. and he exists in a space in memory allocated for a wizard. so an object is a combination of two things: object -state of the object stored as member variables -set of methods that give the object ability to perform certain tasks. you may have guessed that objects are the foundation of object-oriented programming and Java.  The reason they were created was to make programming feel intuitive, to mirror how we as humans experience the world.

Programming language translators

Image
  Assembler compiler interpreter 

programming language

  Language Generation Level Machine Language First Low level Assembly Language(Mnemonics) second Low level Procedural Language(FORTRAN,C,C++,Visual basic,JAva) Third High level Query Language Fourth Very High level

Find Odd & Even number - pseudocode

 Machine language = instructions set + rules about how the instruction can be compailed  A program called an assembler translates assembly language into machine language. A translator analyses the program (source code) and writes an equivalent machine language program. Two type of translators- Compiles and interpreters. 3 type of errors : Syntax errors Logical errors Run time errors Find Odd & Even number - pseudocode BEGIN     INT A,B      GET A     B = A % 2     IF B==0 THEN          DISPLAY  "Event number"     ELSE          DISPLAY "Odd number"     ENDIF END

AttributeError: module 'tensorflow_estimator.python.estimator.api._v2.estimator' has no attribute 'inputs'

AttributeError : module 'tensorflow_estimator.python.estimator.api._v2.estimator' has no attribute 'inputs' Solution tf . compat . v1 . estimator . inputs . pandas_input_fn

Learn about machine learning

Image
  The majority of AI solutions are built on the foundation of machine learning. How machine learning works So how do machines learn? The answer is, from data. As we go about our daily lives in today's society, we generate massive amounts of data. We generate vast amounts of data, from the text messages, emails, and social media postings we send to the images and movies we snap on our phones. Millions of sensors in our homes, cars, communities, public transportation networks, and factories continue to generate more data. All of this information may be used by data scientists to train machine learning models that can make predictions and inferences based on the associations found in the data.

What is artificial intelligence (AI)?

Image
Simply described, artificial intelligence (AI) is the development of software that mimics human actions and skills. Machine learning - This is how we "train" a computer model to make predictions and draw conclusions from data, and it is frequently the foundation for an AI system. Anomaly detection - Anomaly detection is the capacity to detect mistakes or unexpected behaviour in a system automatically. Computer vision - Computer vision is the ability of software to use cameras, video, and photographs to interpret the world visually. Natural language processing -  Natural language processing (NLP) is the ability of a computer to understand and respond to written or spoken language. Conversational AI -  Conversational AI - A software "agent's" capacity to participate in a conversation.

Why Flutter? not others?

Image
Why Flutter? not others? It is free and open-source Developed by google It is trending and adaptation Good opportunity Faster than other platforms Easy to learn Community support

Tensorflow

Image
Tensorflow a software framework for building and deploying machine learning models.it is a low-level tool kit. developed internally at Google, made public in late 2015, the first stable version in 2017, open-sourced. what can you build with TensorFlow? image recognition speech recognition image style transfer language translation. tensor flow alternatives theano torch pytorch Programming language support TensorFlow's core execution is written in c++ for speed. python is the best supported and easiest language to use with TensorFlow.

import and export keywords.

Image
Components have to be nested into the main component using import and export keywords. Export: The export feature is used to export a particular module(file) and use it in another module (file). Import: The import feature is used to import a particular module(file) and use it in another module (file).

Use case implementation using tensorflow

Image
Using cansus data, let's use several traits of an individual to estimate what income class they belong to (>50k or <=50k). here with cansus data's drive link. https://drive.google.com/drive/folders/1NPPMs52EOkPUTwimmyCBx0b7qCeQ-9yB?usp=sharing Q1) what is the advantage of using TensorFlow? the main advantage is  TensorFlow offers high-level APIs. In this case we will use estimator API to create Classifier (linearClassifier). in census_data .csv keep age, workclass, Final-weight, education,education-num,Marital-Status,occupation,relationship,race,sex,capital-Gain,Capital-loss,hours-per-week,native-country,class coloums.here  class coloum is our target  let's build a model read the census_data.csv using the pandas library. import  pandas  as  pd census = pd.read_csv ( "/content/census_data.csv" ) cheak and view   census_data.csv head/1st row ,using head() function. census.head () more... My_income-class-prediction-using-tenso...

AttributeError: module 'tensorflow_estimator.python.estimator.api._v2.estimator' has no attribute 'inputs'

 problem input_func=tf.estimator.inputs.pandas_input_fn ( x=X_train , y=y_train , batch_size= 100 , num_epochs= None , shuffle= True ) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-20-05296931bd4c> in <module> () ----> 1 input_func = tf . estimator . inputs . pandas_input_fn ( x = X_train , y = y_train , batch_size = 100 , num_epochs = None , shuffle = True ) AttributeError: module 'tensorflow_estimator.python.estimator.api._v2.estimator' has no attribute 'inputs' solution input_func=tf.compat.v1.estimator.inputs.pandas_input_fn ( x=X_train , y=y_train , batch_siz e= 100 , num_epochs= None , shuffle= True )

The method 'pickIamge' isn't defined for the type 'ImagePicker'.

The method 'pickIamge' isn't defined for the type 'ImagePicker'. Try correcting the name to the name of an existing method, or defining a method named 'pickIamge'. problem:--   File imageFile;   _openGallary()  async  {      var  picture =  await  ImagePicker. pickIamge (source: ImageSource. gallery );      this .setState(() {       imageFile = picture;     });   }  here with you can simply check _openGallary function for imagepicker .πŸ†—πŸ‘Œ   _openGallary()  async  {      var  picture =  await   ImagePicker().getImage(source: ImageSource.gallery);      this .setState(() {       imageFile = picture  as  File;     });

Tensorflow basic variables const placeholder

Tensorflow basic variables const placeholder example 1:  import  tensorflow.compat.v1  as  tf #this is a veriable zero = tf.Variable ( 0 ) #this is a constant one = tf.constant ( 1 ) new_value = tf.add ( zero , one ) #variable value can be chNGED update= tf.compat.v1.assign ( zero , new_value ) #init_op = tf.initialize_all_variables() init_op = tf.global_variables_initializer () sess = tf.Session () #initialize variables sess.run ( init_op ) print ( sess.run ( zero ))

AttributeError : module 'tensorflow' has no attribute 'global_variables_initializer'

module 'tensorflow' has no attribute 'global_variables_initializer'. it is an AttributeError. πŸ’»problem #init_op = tf.initialize_all_variables() init_op =  tf.global_variables_initializer () --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-13-9cab3748941a> in <module>() 12 13 #init_op = tf.initialize_all_variables() ---> 14 init_op = tf.global_variables_initializer() 15 16 sess = tf.Session() AttributeError: module 'tensorflow' has no attribute 'global_variables_initializer' πŸ’»Changes should be made #init_op = tf.initialize_all_variables() init = tf.compat.v1.global_variables_initializer ()

'Tensor' object has no attribute 'assign' solution

πŸ’»problem   update= tf.assign zero new_value ) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-11-22ec8ea000b1> in <module>() 9      10 #variable value can be chNGED ---> 11 update= tf.assign(zero,new_value) 12 13 #init_op = tf.initialize_all_variables() AttributeError: module 'tensorflow' has no attribute 'assign' πŸ’»Changes should be made #variable value can be chNGED update= tf.compat.v1.assign(zero,new_value)

Audio Book using python

Image
we can convert any pdf to an audiobook using python. Only two Python libraries are required. 1. pyttsx3 2. PyPDF2 and you need to import your pdf document under this project folder too. let's start πŸ’» step 1:  import both libraries  using import keyword, import pyttsx3 import PyPDF2 πŸ’» step 2: we need to open our pdf document using the  open function. open syntax book  = open(“ filename ”, “mode”) where book is the variable to add the file object. filename is your pdf file name. book = open ( 'event.pdf' , 'rb' ) πŸ’» step 3: call pdf reader function to read your pdf document. pdfReader = PyPDF2.PdfFileReader(book) πŸ’» step 4: Get pdf pages details for example 200 page pdf or 1000 page pdf document print(page) command is just optional. page = pdfReader.numPages print (page)// optional πŸ’» step 5: initialize speaker and save it into speaker   variable  speaker = pyttsx3.init() πŸ’» step 6: define which page you gonna read, using the get page function...

Tensorflow

Image
This is a  ensorFlow(TensorFlow ) example. you can simply run using ' Google colab ' (https://colab.research.google.com/ ) or ' Jupyter note book' ( https://jupyter.org/try). πŸ’» step one : you need to install  ! pip install matplotlib ! pip install tensorflow run. πŸ‘‡πŸ‘‡ πŸ’»Step 2 : import paxkages such as tensorflow ,numpy, matplotlib. here you can view import coding. πŸ‘‡πŸ‘‡ import  tensorflow  as  tf import  numpy  as  py import  matplotlib.pyplot  as  plt from  tensorflow.examples.tutorials.mnist  import  input_data πŸ’»Step 3 : coding. πŸ‘‡πŸ‘‡ mnist = input_data.read_data_sets ( "MNIST/" , one_hot= True ) fig ,  ax = plt.subplots ( 10 ,   10 ) run. πŸ‘‡πŸ‘‡ πŸ’»Step 4 : coding. πŸ‘‡πŸ‘‡ k= 0 for  i  in   range ( 10 ):      for  j  in   range ( 10 ):         ax [ i ][ j ] .imshow ( mnist.train.im...

AttributeError: module 'matplotlib' has no attribute 'subplots'

Image
AttributeError: module 'matplotlib' has no attribute 'subplots'  Description of the issue AttributeError: module 'matplotlib' has no attribute 'subplots' The reason for this When a package for importing data is written, import matplotlib as plt   Changes should be made import matplotlib .pyplot as plt

Kahoot

Image
  Advantages of Kahoot ·          The first and foremost advantage of Kahoot is that it offers a great engagement from the students’ side. They enjoy it as it is a visualized and unique type of quiz. ·          As the students’ interest level is high, the teachers can easily assess the understanding level through quizzes and polls. ·          Kahoot has become very successful in reducing monotony and boredom. ·          It is an energetic and lively platform. ·          It can be used as a tool of assessment for the teachers. ·          Kahoot has been successful in creating a positive environment among the students by creating motivation. ·          It has increased the students’ performance ...

TOP TOOLS TO WRITE YOUR PYTHON PROGRAMS

Jupyter Notebook This is installed alongside the anaconda utility and runs on the web using the localhost server. The entire notebook is separated into cells, with each cell's output displayed below it. The code is automatically saved in real-time. Linux, macOS, and Windows are all supported. Google Colab Notebook Google's research team has given a Jupyter notebook. Jupyter Notebook works in a similar way. In the interface, including both text and cell blocks. There is no use of local memory. It's entirely cloud-based. The code is automatically saved in real-time. Linux, macOS, and Windows are all supported. Pycharm JetBrains offers free open-source software for writing Python programs. It's a stand-alone system that works. Provides an integrated environment that simplifies library installation, debugging, and event triggering. For version control, it can be linked to git. The files are not automatically stored. Linux, macOS, and Windows are all supported. Spyder An ope...