<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Adarsh Chaurasiya on Medium]]></title>
        <description><![CDATA[Stories by Adarsh Chaurasiya on Medium]]></description>
        <link>https://medium.com/@adarshkumarchaurasiya?source=rss-aaa3177c7b6a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Tscpk7_QuliIohUh</url>
            <title>Stories by Adarsh Chaurasiya on Medium</title>
            <link>https://medium.com/@adarshkumarchaurasiya?source=rss-aaa3177c7b6a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:32:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adarshkumarchaurasiya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Card Based Fraud]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/card-based-fraud-1dfe5efa7373?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/1dfe5efa7373</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[twilio]]></category>
            <category><![CDATA[sqlite3]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Fri, 31 May 2024 10:34:41 GMT</pubDate>
            <atom:updated>2024-06-22T11:06:36.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*JGRhoR3Ljki4u78Z" /></figure><p>To combat OTP-based fraud, educate users on the risks of sharing OTPs, implement strong authentication protocols, use transaction alerts, and deploy AI-driven fraud detection systems. Additionally, regularly update security measures and provide clear communication channels for reporting suspicious activities.</p><p>In contemporary India, a growing threat lurks in the form of fraudulent calls targeting unsuspecting individuals. Scammers employ manipulative tactics, posing as legitimate entities to instill fear by falsely claiming that the victim’s bank account is at risk of being blocked. To avert this fictitious crisis, they cunningly request the victim’s One-Time Password (OTP) under the guise of security verification. Tragically, this deceptive maneuver results in the loss of hard-earned money for those who fall prey to these scams. In the digital age, it is crucial for individuals to remain vigilant, recognizing such schemes and safeguarding their financial information from these nefarious actors</p><p>To solve OTP-based fraud, we can use geolocation data by comparing the locations of the payment initiator and the cardholder. If the distance between them exceeds 200 meters, the payment is denied; otherwise, it is approved. This method enhances security by ensuring transactions occur within a reasonable proximity of the legitimate user.</p><p><strong>Tech stack and packages used</strong></p><p>1-Used Pycharm, Juypter,db browser</p><p>2-Streamlit,sqlite3,time,response,requests,TwilioAPI</p><p><strong>Solution:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nohgVKR2piCj4XnQ6DE2w.png" /></figure><p><strong>Implementation:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U2A4_I-f5XlcPMarpS-DSw.png" /></figure><p>First page if we click to the Buy now the next page is like that:</p><p>2-Card Details Pages and you the option by default and manual in the top left corner if <strong>By default</strong> payments take the location of <strong>both payment initiators and card holder location </strong>if the mode is<strong> manual</strong> then it means we can pay from anywhere. <strong>This manual mode is opened by bank only if person need.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtgoHpJ26LsfWZYHFrjmsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lY4dIxMTE0DBQcqOWPoitg.png" /></figure><p>3-Now this payment verification page if the location of the user and payment initiators is between 200 then it is successful else payment is denied. Send link to the card holders &#39; mobile using Twilio API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hHE5QcUVJNL4d9aqvYvm9A.png" /></figure><p>Just Store the location of the user and the location of payment initiators in the database compare both latitude and longitude coordinates and make a mathematical formula that requires 4 parameters:</p><p>lat1,lat2,long1,long2…</p><p>and it gives the exact distance between payment initiators and cardholders.</p><p>Thank you…………👨‍💻👌🚀🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1dfe5efa7373" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Twitter Sentiments Analysis using N.L.P. (Python)]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/twitter-sentiments-analysis-using-n-l-p-python-52e694d07630?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/52e694d07630</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 06:07:21 GMT</pubDate>
            <atom:updated>2024-03-21T06:07:21.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CCH1nR9cyOQ13AvW.jpg" /></figure><p>Nowadays, the age of Internet has changed the way people express their views, opinions. It is now mainly done through blog posts, online forums, product review websites, social media ,etc. Nowadays, millions of people are using social network sites like Facebook, Twitter, Google Plus, etc. to express their emotions, opinion and share views about their daily lives. Through the online communities, we get an interactive media where consumers inform and influence others through forums. Social media is generating a large volume of sentiment rich data in the form of tweets, status updates, blog posts, comments, reviews, etc. Moreover, social media provides an opportunity for businesses by giving a platform to connect with their customers for advertising. People mostly depend upon user generated content over online to a great extent for decision making. For e.g. if someone wants to buy a product or wants to use any service, then they firstly look up its reviews online, discuss about it on social media before taking a decision. The amount of content generated by users is too vast for a normal user to analyze. So there is a need to automate this, various sentiment analysis techniques are widely used.</p><p>Sentiment analysis can be defined as a process that automates mining of attitudes, opinions, views and emotions from text, speech, tweets and database sources through Natural Language Processing (NLP). Sentiment analysis involves classifying opinions in text into categories like “positive” or “negative” or “neutral”. It’s also referred as subjectivity analysis, opinion mining, and appraisal extraction.</p><p>Steps:</p><p>1-Import the dataset</p><p>2–</p><h4><strong>0 stands for a neutral sentiments</strong></h4><h4>1 stands for a positive sentiments</h4><h4>2 stands for a negative sentiments</h4><p>3-Perform eda on the data</p><pre>counts=data[&#39;target&#39;].value_counts()<br>count_s=[counts[0],counts[1],counts[2]]<br>targets=[&quot;NUETRAL&quot;,&quot;POSITIVE&quot;,&quot;NEGATIVE&quot;]<br>plt.bar(targets,count_s,color=[&#39;c&#39;,&#39;g&#39;,&#39;r&#39;])<br>plt.title(&quot;SENTIMENT DISTRIBUTION&quot;)<br>plt.xlabel(&#39;SENTIMENTS&#39;)<br>plt.ylabel(&#39;COUNTS&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*lHIIgBbq7ytJVb76XjtwTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*H-pHgAldXKmUBUyM_H2pNg.png" /></figure><p>4-Clean the text-&gt;# Clean the text<br>##### 1-Remove html tags<br>##### 2-Extract Emojies using complie-&gt; used and match and extract emoji from a given text<br>##### 3-Removing special char,punctuation,symbols<br>##### 4-Convert text to lower casing<br>##### 5-Remove Stopwords<br>##### 6-Tokenization</p><pre>#function where our text is clean<br>def cleaning(text):<br>    text=re.sub(&#39;&lt;[^&gt;]*&gt;&#39;,&#39;&#39;,text)#html tags<br>    emoji=emoji_words.findall(text)<br>    text=re.sub(&#39;[\W+]&#39;,&#39; &#39;,text.lower())+&#39; &#39;.join(emoji).replace(&#39;-&#39;,&#39;&#39;)<br>    prter=PorterStemmer()<br>    text=[prter.stem(word) for word in text.split() if word not in stop_words]<br>    return &quot; &quot;.join(text)</pre><p>5-Apply Count vectorizer-&gt;extract maxfeatures</p><pre>from sklearn.feature_extraction.text import CountVectorizer<br>nuetraltext=data[data[&#39;target&#39;]==0]<br>nuetralsentence=nuetraltext[&#39;text&#39;].str.cat(sep=&#39;, &#39;)<br>count_vec=CountVectorizer(max_features=100)<br>a=count_vec.fit_transform({nuetralsentence})<br>#same do for the negative and positive<br>print(count_vec.get_feature_names_out())</pre><p>6-Use tfidf vectorizers</p><pre>from sklearn.feature_extraction.text import TfidfVectorizer<br><br>tfidf=TfidfVectorizer(strip_accents=None,lowercase=False,preprocessor=None,use_idf=True,norm=&#39;l2&#39;,smooth_idf=True)<br>y=data.target.values<br>x=tfidf.fit_transform(data.text)</pre><p>7-split the data</p><pre>from sklearn.model_selection import train_test_split<br>X_train,X_test,y_train,y_test=train_test_split(x,y,random_state=1,test_size=0.5,shuffle=False)</pre><p>8-Apply Logistic Regression</p><pre>from sklearn.linear_model import LogisticRegressionCV<br>clf=LogisticRegressionCV(cv=6,scoring=&#39;accuracy&#39;,random_state=0,n_jobs=-1,verbose=3,max_iter=500).fit(X_train,y_train)<br>y_pred = clf.predict(X_test)</pre><p>9-Predict</p><p>10-function</p><pre>def prediction(comment):<br>    preprocessed_comment = cleaning(comment)<br>    comment_list = [preprocessed_comment]  # Wrap the preprocessed comment in a list<br>    comment_vector = tfidf.transform(comment_list)<br>    prediction = clf.predict(comment_vector)[0]<br>    return prediction<br><br><br><br>prediction = prediction(&quot;THIS IS GOOD&quot;)<br>if prediction == 1:<br>    print(&quot;positive comment&quot;)<br>elif(prediction ==0):<br>    print(&quot;neutral comment&quot;)<br>else:<br>    print(&quot;negative comment&quot;)</pre><p>11-Dump the file</p><pre>import pickle<br>pickle.dump(clf,open(&#39;classifier.pkl&#39;,&#39;wb&#39;))<br>pickle.dump(tfidf,open(&#39;tfidf.pkl&#39;,&#39;wb&#39;))</pre><p><strong>Design a layout using streamlit</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZ7ZZ8_liulrTg8MSc7vKw.png" /></figure><p>In conclusion, Twitter sentiment analysis offers valuable insights into public opinion, attitudes, and emotions expressed on the platform. Through the application of natural language processing (NLP) techniques and machine learning algorithms, sentiment analysis tools can effectively categorize tweets as positive, negative, or neutral, enabling businesses, researchers, and policymakers to extract actionable insights and make informed decisions.</p><p>Thank You 👨‍💻😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52e694d07630" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Movie Recommendation System — Bollywood and Hollywood using Python,Streamlit and count vectorizer]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/movie-recommendation-system-bollywood-and-hollywood-using-python-streamlit-and-count-vectorizer-31877398c72c?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/31877398c72c</guid>
            <category><![CDATA[count-vectorizer]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 05:15:41 GMT</pubDate>
            <atom:updated>2024-03-21T05:34:23.375Z</atom:updated>
            <content:encoded><![CDATA[<h3>Movie Recommendation System — Bollywood and Hollywood using Python,Streamlit and count vectorizer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z6jrunDSj9aNOmjD" /></figure><p>A recommendation system, sometimes known as a recommendation engine, is a paradigm for information filtering that aims to anticipate user preferences and offer suggestions in accordance with these preferences. These technologies are now widely used in a variety of industries, including those that deal with utilities, books, music, movies, television, apparel, and restaurants. These systems gather data on a user’s preferences and behavior, which they then employ to enhance their future suggestions.</p><p>A movie recommendation engine is a system that suggests movies to users based on their preferences, ratings, or viewing history. There are different types of movie recommendation engines, such as content-based, collaborative filtering, or hybrid methods. Each of these methods uses different algorithms and data sources to provide personalized and accurate recommendations.</p><p>Watching movies is fun, but figuring out what movie to watch next is a nerve-racking experience. Endlessly scrolling through 📺<a href="https://www.netflix.com/in/">Netflix</a>, watching trailers on 📺<a href="https://www.youtube.com/">Youtube</a> looking up 📺<a href="https://www.imdb.com/">IMDB Rating</a>, wasting half an hour and still cannot decide what to watch — does this seem familiar to you?Then you have landed on the right page! PickAMovieForMe’s movie recommendation engine is the answer to the question “What movie should I watch?”! Your film choices are about to be simplified greatly.</p><p>##What Makes This Movie Recommendation Engine Unique?</p><p>— All listed movies are hand-picked and manually tagged by film connoisseurs ensuring high quality recommendations</p><p>— you get Five recommendation at a time, so there isn’t a hard decision again</p><p>— new movies are added consistently</p><p>— Like you Avengers Movie Recently Then you want to see similar movie like Avengers So,Select Avenger and then it give 5 Recommendations Related to the Movie Avenger</p><p>— movies based on true stories or books, Spy Movies, Cop Movies, Heist Movies, Girl Power Movies, Racing Movies, Space Movies, Wedding Movies, IMDb Top 250 movies, movies set in New York, movies set in Las Vegas, movies that may change the way you look at life …</p><p>Some of the tools and techniques that you can use to build a movie recommendation engine are:Streamlit: Streamlit is an open-source Python library that allows you to create interactive web apps for data science and machine learning. You can use streamlit to display your data, visualize your results, and create a user interface for your movie recommendation engine. You can also deploy your app to the cloud using streamlit sharing or streamlit cloud.</p><p>Python: Python is a popular programming language for data science and machine learning. You can use Python to write the logic and functionality of your movie recommendation engine, such as loading and processing the data, applying the algorithms, and generating the recommendations.</p><p>Numpy: Numpy is a Python library that provides high-performance numerical computation and manipulation of multidimensional arrays and matrices. You can use numpy to perform mathematical operations on your data, such as calculating the similarity or distance between movies or users, or performing matrix factorization for collaborative filtering.</p><p>API: API stands for Application Programming Interface, which is a set of rules and protocols that allow different software components to communicate and exchange data. You can use an API to access external data sources for your movie recommendation engine, such as movie databases, ratings, reviews, or metadata. For example, you can use the TMDB API to get information about movies, genres, actors, etc.</p><p>SLTK: SLTK stands for Scikit-Learn Toolkit, which is a Python library that provides a collection of tools and algorithms for machine learning and data analysis. You can use SLTK to implement various methods for movie recommendation, such as content-based filtering, collaborative filtering, or hybrid methods. SLTK also provides functions for preprocessing, feature extraction, model selection, evaluation, and more.</p><p>Vectorization: Vectorization is a technique that converts text or other types of data into numerical vectors that can be used for machine learning. You can use vectorization to represent movies or users as vectors based on their features, such as genre, cast, director, keywords, ratings, etc. You can also use vectorization to measure the similarity or dissimilarity between movies or users, such as cosine similarity, euclidean distance, or Jaccard index.</p><p>CSS: CSS stands for Cascading Style Sheets, which is a language that describes how HTML elements are displayed on a web page. You can use CSS to customize the appearance and layout of your Streamlit app, such as colors, fonts, margins, borders, etc. You can also use CSS to create animations, transitions, or effects for your app.</p><p><strong>Project Video:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVrZu5pzWTUU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVrZu5pzWTUU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVrZu5pzWTUU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b64e9eebd464cdbaed6a00cf94dd616/href">https://medium.com/media/5b64e9eebd464cdbaed6a00cf94dd616/href</a></iframe><p><strong>Steps:</strong></p><p>1-Collect the dataset from the kaggle.</p><p><a href="https://www.kaggle.com/datasets/tmdb/tmdb-movie-metadata?resource=download&amp;select=tmdb_5000_movies.csv"><strong>link of the dataset</strong></a></p><p>2-Data Preprocessing.</p><p>3-Merge Both Table-&gt;Movies,Credits.</p><pre>movies=pd.read_csv(&quot;tmdb_5000_movies.csv&quot;)<br>credits=pd.read_csv(&quot;tmdb_5000_credits.csv&quot;)<br>print(movies.shape)#so we have 4803 rows and 20 columns<br>print(credits.shape)#here we have 4803 rows and 4 cols</pre><pre>movies=movies.merge(credits,on=&#39;title&#39;)</pre><p>4-Remove Useless Columns-&gt;Budget,Homepage,Popularity,Production Companies,Release date,revenue,runtime,language,status because by these columns we can’t recommend the movie.</p><p>5-Imp.Columns-&gt;MovieId, title, overview, genres, keywords, cast/crew by these columns we easily recommend the movie to anyone.</p><pre>movies=movies[[&#39;movie_id&#39;,&#39;title&#39;,&#39;overview&#39;,&#39;genres&#39;,&#39;keywords&#39;,&#39;cast&#39;,&#39;crew&#39;]]</pre><p>6-Check Missing Values and remove</p><pre>movies.isnull().sum() <br>#we have to drop these rows because 3 is not big digit in 5000<br>movies.dropna(inplace=True)</pre><p>7-Check Duplicate Values</p><pre>movies.duplicated().sum()</pre><p>8-Now Organise the col keywords,cast,crew</p><pre>#&#39;[{&quot;id&quot;: 28, &quot;name&quot;: &quot;Action&quot;}, {&quot;id&quot;: 12, &quot;name&quot;: &quot;Adventure&quot;}, {&quot;id&quot;: 14, &quot;name&quot;: &quot;Fantasy&quot;}, {&quot;id&quot;: 878, &quot;name&quot;: &quot;Science Fiction&quot;}]&#39;<br>#convert this in into this format-&gt;[&#39;Action&#39;,&#39;Adventure&#39;,&#39;Fantasy&#39;,&#39;Science Fiction&#39;]<br>#create a function<br>def convert(obj):<br>    l=[]<br>    for i in ast.literal_eval(obj):#by this string is comes under the list<br>        l.append(i[&#39;name&#39;])<br>    return l</pre><pre># Make function to extract the director name<br>def fetch_director(obj):<br>    l=[]<br>    for i in ast.literal_eval(obj):#by this string is comes under the list<br>        if(i[&#39;job&#39;]==&#39;Director&#39;):<br>            l.append(i[&#39;name&#39;])<br>            break<br>    return l</pre><p>9-convert each row and each col in list</p><pre>#convert string into list<br>movies[&#39;overview&#39;].apply(lambda x:x.split())</pre><p>10-Concate each columns.</p><pre>movies[&#39;tag&#39;]=movies[&#39;overview&#39;]+movies[&#39;genres&#39;]+movies[&#39;keywords&#39;]+movies[&#39;cast&#39;]+movies[&#39;crew&#39;]</pre><p>11-Now change the list into string and convert into lower case</p><pre># Now I convert the tag in a string, which is already in list. Then we have to convert it into the string.<br>newdf[&#39;tag&#39;]=movies[&#39;tag&#39;].apply(lambda x:&quot; &quot;.join(x))</pre><pre>newdf[&#39;tag&#39;]=newdf[&#39;tag&#39;].apply(lambda x:x.lower())</pre><p>12-Apply NLTK-&gt;PorterStemmer()</p><pre>from nltk.stem.porter import PorterStemmer<br>ps=PorterStemmer()<br>def stem(text):<br>    y=[]<br>    for i in text.split():<br>        y.append(ps.stem(i))<br>    return &quot; &quot;.join(y)<br>newdf[&#39;tag&#39;].apply(stem)</pre><p>13- Use Vectorization-&gt;Convert each and every string into vector</p><pre># Import skit learn.<br>from sklearn.feature_extraction.text import CountVectorizer<br>cv=CountVectorizer(max_features=5000,stop_words=&#39;english&#39;)<br>cv.fit_transform(newdf[&#39;tag&#39;]).toarray()<br>cv.fit_transform(newdf[&#39;tag&#39;]).toarray()<br>vector=cv.fit_transform(newdf[&#39;tag&#39;]).toarray()<br>feature=cv.get_feature_names_out()#we see most frequent words<br></pre><p>14-By cosinesimilarity we got the similarity among movies-&gt;Distance more means similarities is more and less distance means less similarity</p><pre>from sklearn.metrics.pairwise import cosine_similarity<br>similarity=cosine_similarity(vector)<br>sorted(list(enumerate(similarity[0])),reverse=True,key=lambda x:x[1])[1:6]</pre><p>so fetch top 5 similarity an display</p><p>Recommmend function:</p><pre>def recommend(movie):<br>    #fetch the index<br>    if(movie[0].islower()):<br>        movie=movie.capitalize() # if the first letter of the movie is in small letter then convert it into uppercase<br>    movie_index=newdf[newdf[&#39;title&#39;]==movie].index[0]<br>    distances=similarity[movie_index]<br>    movies_list=sorted(list(enumerate(distances)),reverse=True,key=lambda x:x[1])[1:6]<br>    for i in movies_list:<br>        print(newdf.iloc[i[0]].title)</pre><p>15- Dump the file df and similarity.</p><pre>import pickle<br>pickle.dump(newdf,open(&#39;movies.pkl&#39;,&#39;wb&#39;))<br>newdf.to_dict()# rather than send the dataframe i&#39;ll send only dictionary<br>pickle.dump(newdf.to_dict(),open(&#39;movies_dict.pkl&#39;,&#39;wb&#39;))<br>pickle.dump(similarity,open(&#39;similarity.pkl&#39;,&#39;wb&#39;))</pre><p>16-Import these file in pycharm</p><p>DESIGN THE LAYOUT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qbNIfFSzaRt4c1MIR9itIQ.png" /></figure><p><strong>Bollywood Recommendation:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X2bPvPDKDpwtpXiYs0ePEQ.png" /></figure><p><strong>Hollywood Recommendation:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NxqtUnapH2icj46CS1yU1Q.png" /></figure><p>Thank You👨‍💻😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31877398c72c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detection System-Object Detection using YOLOV8(Using WebCam)]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/detection-system-object-detection-using-yolov8-using-webcam-12929704d1f9?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/12929704d1f9</guid>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[yolo]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[yolov8]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 18:08:59 GMT</pubDate>
            <atom:updated>2024-03-21T07:47:45.785Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f0AbYROCymebsmXR.jpg" /></figure><p>Object detection has become an increasingly popular field in computer vision, with YOLO (You Only Look Once) being one of the most widely used algorithms. In this blog post, we will explore how to use YOLO and a webcam to get started with a real-time object detection system.</p><p>Unlike traditional object detection algorithms that require multiple passes over an image, YOLO processes the entire image in a single pass, making it much faster and more efficient.</p><p><strong>Steps:</strong></p><p>To begin, we’ll need to set up your environment. We need a Python environment with OpenCV, a popular computer vision library, and YOLO installed.</p><p>1- Install Library:pip install ultralytics</p><p>2-load all these library</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*Y0P6UIbQeuvU6M_MxJLyPA.png" /></figure><p><strong>3-Use Webcam :</strong></p><pre>import cv2<br>cap = cv2.VideoCapture(0)<br>cap.set(3, 640)<br>cap.set(4, 480)<br>while True:<br> ret, img= cap.read()<br> cv2.imshow(&#39;Webcam&#39;, img)<br> if cv2.waitKey(1) == ord(&#39;q&#39;):<br> break<br>cap.release()<br>cv2.destroyAllWindows()</pre><p>In the above code, we create a VideoCapture object and set it to capture frames from the default camera (0). It sets the resolution of the webcam to 640x480. We then loop through the frames and display them in a window until the user presses ‘q’ to exit.</p><p>4- The YOLO model is loaded using the ultralytics library and specifies the location of the YOLO weights file in the yolo-Weights/yolov8n.pt.</p><p><strong>5-LOAD MODEL:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*-Xhwc--i8uI9GOwoGqOkKA.png" /></figure><p>6-We instantiate a classNames variable containing a list of object classes that the YOLO model is trained to detect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6r7FMm0dUqMvZNKXwutZ2Q.png" /></figure><p>7-The while loop starts and it reads each frame from the webcam using cap.read(). Then it passes the frame to the YOLO model for object detection. The results of object detection are stored in the ‘results’ variable.</p><p><strong>FINAL CODE :</strong></p><pre>from ultralytics import YOLO<br>import cv2<br>import matplotlib.pyplot as plt<br>import cvzone<br><br>cap=cv2.VideoCapture(1)<br>cap.set(3,1280)<br>cap.set(4,780)<br>if not cap.isOpened():<br>    cap=cv2.VideoCapture(0)<br>if not cap.isOpened():<br>    raise IOError(&quot;Cannot open Webcam&quot;)<br><br><br>model=YOLO(&#39;../Yolo-Weights/yolov8l.pt&#39;)<br>classNames = [&quot;person&quot;, &quot;bicycle&quot;, &quot;car&quot;, &quot;motorbike&quot;, &quot;aeroplane&quot;, &quot;bus&quot;, &quot;train&quot;, &quot;truck&quot;, &quot;boat&quot;,<br>              &quot;traffic light&quot;, &quot;fire hydrant&quot;, &quot;stop sign&quot;, &quot;parking meter&quot;, &quot;bench&quot;, &quot;bird&quot;, &quot;cat&quot;,&quot;lion&quot;,<br>              &quot;dog&quot;, &quot;horse&quot;, &quot;sheep&quot;, &quot;cow&quot;, &quot;elephant&quot;, &quot;bear&quot;, &quot;zebra&quot;, &quot;giraffe&quot;, &quot;backpack&quot;, &quot;umbrella&quot;,<br>              &quot;handbag&quot;, &quot;tie&quot;, &quot;suitcase&quot;, &quot;frisbee&quot;, &quot;skis&quot;, &quot;snowboard&quot;, &quot;sports ball&quot;, &quot;kite&quot;, &quot;baseball bat&quot;,<br>              &quot;baseball glove&quot;, &quot;skateboard&quot;, &quot;surfboard&quot;, &quot;tennis racket&quot;, &quot;bottle&quot;, &quot;wine glass&quot;, &quot;cup&quot;,<br>              &quot;fork&quot;, &quot;knife&quot;, &quot;spoon&quot;, &quot;bowl&quot;, &quot;banana&quot;, &quot;apple&quot;, &quot;sandwich&quot;, &quot;orange&quot;, &quot;broccoli&quot;,<br>              &quot;carrot&quot;, &quot;hot dog&quot;, &quot;pizza&quot;, &quot;donut&quot;, &quot;cake&quot;, &quot;chair&quot;, &quot;sofa&quot;, &quot;pottedplant&quot;, &quot;bed&quot;,<br>              &quot;diningtable&quot;, &quot;toilet&quot;, &quot;tvmonitor&quot;, &quot;laptop&quot;, &quot;mouse&quot;, &quot;remote&quot;, &quot;keyboard&quot;, &quot;cell phone&quot;,<br>              &quot;microwave&quot;, &quot;oven&quot;, &quot;toaster&quot;, &quot;sink&quot;, &quot;refrigerator&quot;, &quot;book&quot;, &quot;clock&quot;, &quot;vase&quot;, &quot;scissors&quot;,<br>              &quot;teddy bear&quot;, &quot;hair drier&quot;, &quot;toothbrush&quot;<br>              ] <br>while True:<br>    ret,frame=cap.read()<br>    results=model(frame,stream=True)<br>    font=cv2.FONT_HERSHEY_SIMPLEX<br>    #check bounding boxes<br>    for i in results:<br>        boxes=i.boxes<br>        for box in boxes:<br>            x1,y1,x2,y2=box.xyxy[0]<br>            x1,y1,x2,y2=int(x1),int(y1),int(x2),int(y2)<br>            print(x1,y1,x2,y2)<br>            cv2.rectangle(frame,(x1,y1),(x2,y2),(0,200,0),3)<br>            cls=int(box.cls[0])<br>            <br>            #cv2.putText(frame,classname[cls],(0,200),font,2,(255,0,0),3,cv2.LINE_4);<br>            cvzone.putTextRect(frame,f&#39;{classNames[cls]}&#39;,(max(0,x1),max(35,y1)),scale=2.0)<br>    cv2.imshow(&quot;Image&quot;,frame)<br>    cv2.waitKey(1)</pre><p><strong>Results:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*f6g5YwOHtb8V5QUOv3cjYA.gif" /></figure><p><strong>Application:</strong></p><p>1-Autonomous Vehicles</p><p>2-Surveillance and Security</p><p>3-Industrial Automation</p><p><strong>Conclusion:</strong></p><p>So,we have discussed the steps to implement YOLO webcam detection using Python and OpenCV. By following these steps, you can easily build your own object detection system and customize it to suit your specific needs.</p><p>Overall, YOLO webcam detection is a fascinating area of computer vision with numerous possibilities for future advancements and applications.</p><p>Thank you 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12929704d1f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detection System- Object Detection Using YOLOV8 (Basic Image Detection)]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/detection-system-object-detection-using-yolov8-basic-image-detection-e2f36d2ea55c?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2f36d2ea55c</guid>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[yolo]]></category>
            <category><![CDATA[yolov8]]></category>
            <category><![CDATA[detection]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 17:52:48 GMT</pubDate>
            <atom:updated>2024-03-20T18:16:18.996Z</atom:updated>
            <content:encoded><![CDATA[<p>YOLOv8 allows you to leverage pre-trained models, which are already trained on a vast dataset such as COCO (Common Objects in Context). These models have learned to identify and classify a wide range of objects, making them suitable for various object detection applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*WUczee_8oVqwPsCU.png" /></figure><h3>Getting Started with YOLOv8</h3><p>If you’re ready to dive into the world of YOLOv8 and explore its powerful capabilities for object detection, this section will guide you through the initial steps to get started.</p><p>First and foremost, you’ll need a Python environment to work with YOLOv8. We recommend using Jupyter Notebook for its flexibility and ease of use. If you don’t have it already, you can install it by following the instructions on the official Jupyter website.</p><p><strong>1-Install:</strong></p><pre>pip install ultralytics</pre><p><strong>2-Import these library:</strong></p><pre>from ultralytics import YOLO<br>import cv2<br>import matplotlib.pyplot as plt<br>import cvzone</pre><p><strong>3-Load model:</strong></p><pre>model=YOLO(&#39;../Yolo-Weights/yolov8l.pt&#39;)#getting better results</pre><p><strong>4-Load the image detect about the image using this command:</strong></p><pre>result=model(&quot;RS7840_ThinkstockPhotos-515262698-hig.jpg&quot;,show=True)<br>cv2.waitKey(0)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7cW19nWAR-qNpAeuhIjgnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIpiGj7l5CCSoexXBBCSxQ.png" /></figure><h3>Conclusion</h3><p>In conclusion, YOLOv8 represents a remarkable advancement in real-time object detection within the field of computer vision. Its deep learning model, with its enhanced architecture and cutting-edge features, enables highly accurate object detection across various domains.</p><p>With YOLOv8, real-time object detection becomes a reality in applications such as robotics, autonomous driving, and video monitoring. Its ability to quickly and accurately identify objects in a scene opens up new possibilities for industry and research.</p><p>YOLOv8 builds upon the successes of its predecessors, solidifying YOLO’s position as a leading deep learning model for object detection. Its state-of-the-art algorithm and advanced computer vision techniques make it a go-to choice for professionals in the field.</p><p>As the field of computer vision continues to evolve, further research and improvements will propel real-time object detection systems to new heights. The future holds promising directions for YOLOv8 and its counterparts, as we strive to enhance the performance, accuracy, and usability of these essential technologies.</p><p>Thank you 😊👨‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2f36d2ea55c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gender and Age Recogination-Using DeepFace Analyzer]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/gender-and-age-recogination-using-deepface-analyzer-293b2c835ee7?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/293b2c835ee7</guid>
            <category><![CDATA[deepface]]></category>
            <category><![CDATA[face-detection-app]]></category>
            <category><![CDATA[gender-detection]]></category>
            <category><![CDATA[age-detection]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 17:44:03 GMT</pubDate>
            <atom:updated>2024-03-21T07:09:05.356Z</atom:updated>
            <content:encoded><![CDATA[<p>Gender and age recognition using Python, specifically with the DeepFace library, involves analyzing images or video frames to predict the gender and age of individuals in the images. DeepFace provides pre-trained deep learning models for facial analysis tasks, including gender and age estimation. Here’s an introduction to using DeepFace for gender and age recognition in Python:</p><h3>DeepFace Overview:</h3><p>DeepFace is a Python library built on top of Keras and TensorFlow, offering a range of facial analysis functionalities, including face detection, facial recognition, emotion recognition, gender estimation, and age estimation. It utilizes deep learning models to perform these tasks efficiently.</p><p><strong>Install:</strong></p><pre>pip install deepface</pre><p>1-Import library:</p><pre>import cv2<br>import matplotlib.pyplot as plt<br>from deepface import DeepFace</pre><p>2- Load Image:</p><pre>img=cv2.imread(&#39;happy.jpg&#39;)#load the image</pre><p>3-Fetch the loaded image</p><pre>plt.imshow(cv2.cvtColor(img,cv2.COLOR_BGR2RGB))#get original color image</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*l4zgVAagF1m6EhBDlCfPZw.png" /></figure><p>4-Analyse the face:</p><pre>predict=DeepFace.analyze(img)#inbuilt library where it analyze it deeper</pre><p>5-<strong>Results:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*uwIUyrkrl2AsJTtWqkGeDA.png" /></figure><p>These are the prediction.</p><pre>cv2.putText(img,result[0][&#39;dominant_gender&#39;],(200,150),font,2,(255,0,0),3,cv2.LINE_4); <br>cv2.putText(img,str(result[0][&#39;age&#39;]),(200,200),font,2,(255,0,0),3,cv2.LINE_4)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*OsR3l__wvTcQUX_QvsDZeg.png" /></figure><h3>REAL TIME AGE AND GENDER DETECTION:</h3><p>1-open webcam</p><p>2-Analyse the face</p><p>3-Draw Rectangle</p><p>4-use font family to write the emotion side of of the webcam</p><p><strong>Complete code:</strong></p><pre>import cv2<br>from deepface import DeepFace<br><br>#open webcam<br>facecascade=cv2.CascadeClassifier(cv2.data.haarcascades+&#39;haarcascade_frontalface_default.xml&#39;)<br>cap=cv2.VideoCapture(1)<br>if not cap.isOpened():<br>    cap=cv2.VideoCapture(0)<br>if not cap.isOpened():<br>    raise IOError(&quot;Cannot open Webcam&quot;)<br>#read face  <br>while True:<br>    ret,frame=cap.read()<br>    result=DeepFace.analyze(frame)#analyse face<br>    #draw rectangle<br>    gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)<br>    faces=facecascade.detectMultiScale(gray,1.1,4)<br>    for(x,y,w,h) in faces:<br>        cv2.rectangle(frame,(x,y),(x+w,y+h),(0,255,0),2)<br>    font=cv2.FONT_HERSHEY_SIMPLEX#font type<br>    #write these things<br>    cv2.putText(frame,result[0][&#39;dominant_gender&#39;],(0,100),font,2,(0,0,255),3,cv2.LINE_4);<br><br>    <br>    cv2.putText(frame,str(result[0][&#39;age&#39;]),(0,200),font,2,(255,0,0),3,cv2.LINE_4);<br>    cv2.imshow(&#39;Demo video&#39;,frame)<br>    <br>    if cv2.waitKey(2) &amp; 0xFF==ord(&#39;q&#39;):<br>        break<br>cap.release()<br>cv2.destroyAllWindows()</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*_5EQJACf4r_saZvnC9Ownw.gif" /></figure><p><strong>Benifits:</strong></p><ol><li>Pre-trained Models: DeepFace provides pre-trained deep learning models specifically designed for facial analysis tasks, including gender and age estimation. These models are trained on large datasets, enabling accurate predictions for gender and age based on facial features.</li><li>Ease of Use: DeepFace offers a simple and intuitive API for performing gender and age recognition tasks. With just a few lines of code, you can analyze images or video frames and extract gender and age information from faces.</li><li>Efficiency: DeepFace is built on top of efficient deep learning frameworks like Keras and TensorFlow, allowing for fast and parallelized computations. This ensures that gender and age recognition can be performed quickly, even on large datasets or real-time video streams.</li><li>Accuracy: DeepFace models are trained on diverse datasets, leading to accurate predictions for gender and age across different demographics and facial variations.</li><li>Customization: While DeepFace provides pre-trained models out of the box, it also allows for customization and fine-tuning of models to better suit specific use cases. You can adjust model parameters, train on additional data, or even train entirely new models from scratch if needed.</li><li>Integration: DeepFace can be easily integrated into existing Python applications or workflows. Whether you’re building a mobile app, a web service, or a desktop application, you can incorporate gender and age recognition functionality using DeepFace.</li><li>Real-world Applications: Gender and age recognition have numerous real-world applications, including targeted advertising, demographic analysis, customer segmentation, content recommendation, and user personalization. DeepFace facilitates the implementation of such applications by providing robust gender and age estimation capabilities.</li><li>Community Support: DeepFace benefits from an active community of developers and researchers who contribute to its development and provide support through forums, documentation, and tutorials. This means you can find assistance and resources to help you make the most of the library.</li></ol><p><strong>Applications:</strong></p><ol><li>Demographic Analysis: DeepFace can be used to analyze demographic characteristics of a population based on gender and age distribution. This information is valuable for market research, urban planning, and public policy development.</li><li>Targeted Advertising: Advertisers can use gender and age recognition to tailor advertisements to specific demographic groups. By targeting ads more effectively, advertisers can improve the relevance and effectiveness of their campaigns.</li><li>Content Recommendation: Content recommendation systems in entertainment platforms (such as streaming services) can use gender and age information to personalize recommendations for users. This enhances user experience by suggesting content that aligns with their preferences and demographics.</li><li>Customer Segmentation: Businesses can segment their customer base based on gender and age to better understand their preferences, behaviors, and needs. This enables targeted marketing strategies and product offerings tailored to different customer segments.</li></ol><p>In conclusion, gender and age recognition using DeepFace in Python offers a powerful and versatile tool for analyzing facial images and extracting valuable demographic information. With its pre-trained models, ease of use, and high accuracy, DeepFace enables developers and researchers to implement a wide range of applications across various domains.</p><p>Thank You😊👨‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=293b2c835ee7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recognition Model Real Time-Facial Emotion Recogination using Deepface Analyzer]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/recognition-model-facial-emotion-recogination-using-deepface-analyzer-c305465be123?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c305465be123</guid>
            <category><![CDATA[face-recognition]]></category>
            <category><![CDATA[easy]]></category>
            <category><![CDATA[emotion-recognition]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[deepface]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 17:21:46 GMT</pubDate>
            <atom:updated>2024-03-21T07:00:30.686Z</atom:updated>
            <content:encoded><![CDATA[<p>Facial emotion recognition using Python involves analyzing images or video frames to detect and classify human emotions based on facial expressions. One of the popular libraries for this task is DeepFace, which provides pre-trained deep learning models for facial analysis tasks, including emotion recognition. Here’s an introduction to using DeepFace for face emotion recognition in Python:</p><h3>DeepFace Overview:</h3><p>DeepFace is a Python library built on top of Keras and TensorFlow. It offers a range of facial analysis functionalities, including face detection, facial recognition, facial attribute analysis, and emotion recognition. The library utilizes deep learning models to perform these tasks efficiently.</p><p><strong>Install:</strong></p><pre>pip install deepface</pre><p>1-Import library:</p><pre>import cv2<br>import matplotlib.pyplot as plt<br>from deepface import DeepFace</pre><p>2- Load Image:</p><pre>img=cv2.imread(&#39;happy.jpg&#39;)#load the image</pre><p>3-Fetch the loaded image</p><pre>plt.imshow(cv2.cvtColor(img,cv2.COLOR_BGR2RGB))#get original color image</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*dsdkAiR76wv-hSx-sWvpuQ.png" /></figure><p>4-Analyse the face:</p><pre>predict=DeepFace.analyze(img)#inbuilt library where it analyze it deeper</pre><p>5-Now print Predict:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*A4cCu-CIDSXNQsqZZ4c7jw.png" /></figure><p>These are the prediction.</p><pre>print(&quot;Emotion&quot;,predict[0][&#39;dominant_emotion&#39;])</pre><p><strong>Result:</strong></p><p>Happy</p><h3><strong>REAL TIME EMOTION DETECTION:</strong></h3><p>1-open webcam</p><p>2-Analyse the face</p><p>3-Draw Rectangle</p><p>4-use font family to write the emotion side of of the webcam</p><p><strong>Final Code:</strong></p><pre>import cv2<br>from deepface import DeepFace<br><br>#open webcam<br>facecascade=cv2.CascadeClassifier(cv2.data.haarcascades+&#39;haarcascade_frontalface_default.xml&#39;)<br>cap=cv2.VideoCapture(1)<br>if not cap.isOpened():<br>    cap=cv2.VideoCapture(0)<br>if not cap.isOpened():<br>    raise IOError(&quot;Cannot open Webcam&quot;)<br>#read face  <br>while True:<br>    ret,frame=cap.read()<br>    result=DeepFace.analyze(frame)#analyse face<br>    #draw rectangle<br>    gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)<br>    faces=facecascade.detectMultiScale(gray,1.1,4)<br>    for(x,y,w,h) in faces:<br>        cv2.rectangle(frame,(x,y),(x+w,y+h),(0,255,0),2)<br>    font=cv2.FONT_HERSHEY_SIMPLEX#font type<br>    #write these things<br>    cv2.putText(frame,result[0][&#39;dominant_emotion&#39;],(0,50),font,2,(0,255,0),3,cv2.LINE_4);<br><br>    cv2.imshow(&#39;Demo video&#39;,frame)<br>    <br>    if cv2.waitKey(2) &amp; 0xFF==ord(&#39;q&#39;):<br>        break<br>cap.release()<br>cv2.destroyAllWindows()<br></pre><p><strong>Results:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*7GLWLJoLuaXkTfdh18laZw.gif" /></figure><p>Benifits of using deepface:</p><p>Using DeepFace for facial emotion recognition in Python offers several benefits:</p><ol><li>Pre-trained Models: DeepFace provides pre-trained deep learning models specifically designed for facial analysis tasks, including emotion recognition. These models are trained on large datasets, enabling them to accurately detect and classify emotions in faces.</li><li>Ease of Use: DeepFace offers a simple and intuitive API for performing facial emotion recognition tasks. With just a few lines of code, you can analyze images or video frames and extract emotion information from faces.</li><li>Efficiency: DeepFace is built on top of efficient deep learning frameworks like Keras and TensorFlow, allowing for fast and parallelized computations. This ensures that facial emotion recognition can be performed quickly, even on large datasets or real-time video streams.</li><li>Customization: While DeepFace provides pre-trained models out of the box, it also allows for customization and fine-tuning of models to better suit specific use cases. You can adjust model parameters, train on additional data, or even train entirely new models from scratch if needed.</li><li>Integration: DeepFace can be easily integrated into existing Python applications or workflows. Whether you’re building a mobile app, a web service, or a desktop application, you can incorporate facial emotion recognition functionality using DeepFace.</li><li>Community Support: DeepFace benefits from an active community of developers and researchers who contribute to its development and provide support through forums, documentation, and tutorials. This means you can find assistance and resources to help you make the most of the library.</li><li>Real-world Applications: Facial emotion recognition has numerous real-world applications, including sentiment analysis in market research, human-computer interaction, virtual reality, healthcare (e.g., mental health monitoring), and security (e.g., emotion-aware surveillance systems). DeepFace facilitates the implementation of such applications by providing robust emotion recognition capabilities.</li></ol><h3>Conclusion:</h3><p>DeepFace simplifies facial emotion recognition tasks in Python by providing pre-trained models and a convenient interface. However, keep in mind that the accuracy of emotion recognition heavily depends on the quality of the input image, the diversity of the training data, and the performance of the underlying deep learning models. Experimentation and fine-tuning may be necessary to achieve optimal results for specific use cases.</p><p>Thank You😊👨‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c305465be123" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Classification Model- Cifar -10 Classification using Keras (CNN model)]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/classification-model-cifar-10-classification-using-keras-cnn-model-bc9d03b42708?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc9d03b42708</guid>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cnn]]></category>
            <category><![CDATA[model]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 08:18:26 GMT</pubDate>
            <atom:updated>2024-03-21T04:01:38.330Z</atom:updated>
            <content:encoded><![CDATA[<p>In the vast landscape of computer vision tasks, image classification stands as one of the most fundamental yet challenging endeavors. Among the diverse datasets used for benchmarking image classification algorithms, CIFAR-10 holds a special place. CIFAR-10 comprises 60,000 32x32 color images across ten distinct classes, making it an ideal playground for testing the robustness and versatility of image classification models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*02gL-Yw9HrTXQaDp.jpg" /></figure><p>In this article, we embark on an illuminating journey into the realm of image classification using Keras, a high-level deep learning framework renowned for its simplicity and flexibility. Our mission? To tackle the CIFAR-10 dataset head-on and build a state-of-the-art classification model capable of accurately distinguishing between a myriad of objects and scenes captured in the images.</p><p>The CIFAR-10 dataset presents unique challenges due to its small image size, low resolution, and diverse class distribution. From animals and vehicles to household items and natural scenery, the dataset encompasses a broad spectrum of visual concepts, demanding sophisticated model architectures and robust training strategies.</p><p>Our exploration begins with a comprehensive overview of the CIFAR-10 dataset, including its structure, content, and inherent complexities. We’ll delve into the intricacies of image preprocessing, data augmentation, and normalization techniques tailored to enhance the performance and generalization capabilities of our classification model.</p><p>Using Keras, we’ll construct a variety of convolutional neural network (CNN) architectures, ranging from simple baseline models to advanced architectures inspired by state-of-the-art research. Through a series of hands-on tutorials, we’ll guide you through the process of designing, training, and evaluating CNN models for CIFAR-10 image classification.</p><p>Moreover, we’ll explore cutting-edge techniques such as transfer learning, ensemble methods, and hyperparameter optimization, which can further elevate the performance of our classification model and push the boundaries of what’s achievable on the CIFAR-10 dataset.</p><p>Throughout this article, we’ll showcase code snippets, visualizations, and performance metrics to illustrate the efficacy and robustness of our classification models. Whether you’re a novice eager to dive into the world of deep learning or an experienced practitioner seeking to refine your skills, this article provides valuable insights and practical guidance for mastering image classification with Keras on the challenging CIFAR-10 dataset.</p><p>In conclusion, building a CIFAR-10 image classification model with Keras represents a formidable yet rewarding endeavor in the field of computer vision. By harnessing the power of deep learning and leveraging the versatility of Keras, we can unlock the potential to accurately recognize and classify diverse visual concepts with unprecedented accuracy and efficiency. Join us on this captivating journey as we unravel the complexities of image classification and embark on a quest to conquer the CIFAR-10 challenge with Keras.</p><p>Steps:</p><p>1-Open the dataset</p><p>2-split</p><p>3-reshape the y_Train into 1 d</p><p>4-classes=[“airplane”,”automobile”,”bird”,”cat”,”deer”,”dog”,”frog”,”horse”,”ship”,”truck”]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*1wLC4wGgYOlaUjpVO0IFMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*9E3m5NQpgEDfNHZ6V1PUow.png" /></figure><p>5-flatten the x_train,x_test</p><p>6-make a sequential model()</p><p>7-ADD flatten layer,2 dense layer and one output layer</p><p>8-model.complie()</p><p>9-model.fit(x_train,y_train,epochs=5)</p><p>10-model.evaluate(x_test,y_test)</p><p>but when I use sequential model for that then I got very less accuracy so to optimize the accuracy I use the CNN model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*7ECMpBOg230HeSu6bPCS6Q.png" /><figcaption>sequential model accuracy</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ex2QiYC91dLHbe8PBLY6Vw.png" /></figure><p>Now when I evaluate this model the I got better accuracy -&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9R36AtlIxZ9FNMbglxsayg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*Srvyroyk52eNm0b7Vhdc1Q.png" /></figure><p>This is our Y_pred</p><p>y_classes=[np.argmax(i) for i in y_pred]<br>y_classes[0:10]#this pridiction for first 10class</p><p><strong>Output:</strong></p><p>Input:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*wC68A_qf-yHdJ0t5KcOrpA.png" /></figure><p><strong>Prediction:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*1iW6g9gInoCP0V8h3PNPKw.png" /></figure><p>Thank You😊👨‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc9d03b42708" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Classification Model-Handwritting digit Classification using Keras (CNN model)]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/classification-model-handwritting-digit-classification-using-keras-cnn-model-7f5bdf9267d3?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f5bdf9267d3</guid>
            <category><![CDATA[sequential]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[image-classification]]></category>
            <category><![CDATA[model]]></category>
            <category><![CDATA[classification-models]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 08:04:41 GMT</pubDate>
            <atom:updated>2024-03-21T03:59:34.544Z</atom:updated>
            <content:encoded><![CDATA[<p>In this project, we predict the digit from the image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*SkNn0HOoOdyw_qh1.png" /></figure><p>1-load the Mnist dataset from keras</p><p>2-now split the data</p><p>3-X_train contains the image in pixel,y_train contains the output</p><p>4-flatten the x_Train and x_test-&gt;x_train=x_train/255 xtest=xtest/255</p><p>5-Now make a model-&gt;sequential()</p><p>6-make a neural network-&gt;#so now have to convert 28*28 to 784 using flatten layer<br>model.add(Flatten(input_shape=(28,28)))<br>model.add(Dense(128,activation=’relu’))<br>model.add(Dense(10,activation=’softmax’))#10 output contains means 10 digit have in the model</p><p>7-model.complie()</p><p>8-model.fit()</p><p>8-model.predict(x_test)</p><p><strong>Final Code:</strong></p><pre>import tensorflow<br>from tensorflow import keras<br>from tensorflow.keras import Sequential<br>from tensorflow.keras.layers import Dense,Flatten<br>import matplotlib.pyplot as plt<br><br>(x_train, y_train),( x_test, y_test)=keras.datasets.mnist.load_data()<br><br>print(x_train.shape)<br>print(x_test.shape)<br>print(y_test.shape)<br>print(y_train.shape)<br><br>plt.imshow(x_train[0])<br>x_train=x_train/255<br>x_test=x_test/255<br>model=Sequential()<br>#so now have to convert 28*28 to 784 using flatten layer<br>model.add(Flatten(input_shape=(28,28)))<br>model.add(Dense(128,activation=&#39;relu&#39;))<br>model.add(Dense(10,activation=&#39;softmax&#39;))#10 output contains means 10 digit have in the model<br>model.summary()<br><br>model.compile(loss=&#39;sparse_categorical_crossentropy&#39;, optimizer=&#39;Adam&#39;,metrics=[&#39;accuracy&#39;])<br><br>model.fit(x_train,y_train,epochs=10,validation_split=0.2)<br><br>y_pred=model.predict(x_test)#it gives the probabiltity of 0,1,2,3.......<br><br>y_pred1=y_pred.argmax(axis=1)<br><br>plt.imshow(x_test[0])<br><br>print(model.predict(x_test[0].reshape(1,28,28)).argmax(axis=1))#gives 7<br></pre><p><strong>Predict the digit of the image-&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*29acfXlJwJJEhyF57ZJXaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*M0A6NXotOQDOjCk2foDzbg.png" /></figure><p>gives 7 output.</p><p>Thank You 😊👨‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f5bdf9267d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Price Prediction Model — Car]]></title>
            <link>https://medium.com/@adarshkumarchaurasiya/price-prediction-model-car-ba70a291fe59?source=rss-aaa3177c7b6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba70a291fe59</guid>
            <category><![CDATA[one-hot-encoder]]></category>
            <category><![CDATA[car-price-predictions]]></category>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[model]]></category>
            <category><![CDATA[linear-regression]]></category>
            <dc:creator><![CDATA[Adarsh Chaurasiya]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 07:35:28 GMT</pubDate>
            <atom:updated>2024-03-20T07:35:28.829Z</atom:updated>
            <content:encoded><![CDATA[<h3>Price Prediction Model — Car</h3><p>In the automotive industry, pricing cars accurately is essential for manufacturers, dealerships, and consumers alike. The intricate web of factors influencing car prices — from make and model to mileage, features, and market trends — presents a challenging landscape for pricing decisions. However, with the advent of advanced data analysis techniques, predicting car prices has become more precise and insightful than ever before.</p><p>I predict the price of a car based on kms_driven, fuel type, company, year, and original price of the car.</p><p><strong>Data Collection-</strong></p><p>Import the dataset: Dataset <a href="https://www.kaggle.com/datasets/faseehurrehman/quikr-cars">Link:https://www.kaggle.com/datasets/faseehurrehman/quikr-cars</a></p><p><strong>Data Preprocessing</strong></p><p>The shape of the dataset is 896,6 where the col. year,price,kmsdriven is in the string so converting into the integer means doing Data Preprocessing</p><p>1- year-&gt;convert into the string using .str.numeric() then astype(int)</p><p>2-kmsdriven-&gt;Remove the kms and , from the col kmsdriven using str.replace() then convert into the astype(int)</p><p>3-Price-Price contains Ask for price in some rows so remove this where ask for price present then convert astype(int)</p><p>4-Name-Take only First 3 words of the name</p><p>So after performing Data Preprocessing we got this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*5rxXKAf7GZxOB4HX793svw.png" /></figure><p><strong>Model Training:</strong></p><p>First train test split the data</p><p>1-use ohehotencoder() and fit the data on name,company and fuel type</p><p>2-Do this columns_trans=make_column_transformer((OneHotEncoder(categories=ohe.categories_),[‘name’,’company’,’fuel_type’]),remainder=’passthrough’)</p><p>3-use linearregression()</p><p>4-pipe=make_pipeline(columns_trans,lr)</p><p>5-pipe.fit(x_train,y_train)</p><p>6-y_pred=pipe.predict(X_test)</p><p>7-pipe.predict(pd.DataFrame([[‘Maruti Suzuki Swift’,’Maruti’,2019,100,’Petrol’]],columns=[‘name’,’company’,’year’,’kms_driven’,’fuel_type’]))</p><p>check the price for that.</p><p><strong>Now dump the data in pkl .</strong></p><p>For designing use Streamlit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ZBjWSkx1wQAkmvL-vY56A.png" /></figure><p>UI</p><p>In conclusion, the process of predicting car prices using data analysis offers a myriad of benefits to stakeholders across the automotive industry. By leveraging advanced analytical techniques and machine learning algorithms, companies can unlock valuable insights that drive informed decision-making, enhance competitiveness, and foster innovation.</p><p>Accurate car price prediction enables manufacturers and dealerships to optimize pricing strategies, improve inventory management, and streamline marketing efforts. For consumers, it ensures fair value and transparency in transactions, leading to greater satisfaction and trust in the buying process. Financial institutions benefit from risk mitigation and more informed lending decisions, ultimately contributing to a more resilient and stable financial ecosystem.</p><p>Moreover, car price prediction serves as a catalyst for data-driven innovation, driving continuous improvement and adaptation to evolving market dynamics. As technology advances and datasets grow more extensive, the potential for predictive analytics in the automotive industry continues to expand, offering new opportunities for growth and differentiation.</p><p>In essence, the ability to predict car prices accurately represents a transformative application of data analysis, empowering stakeholders to navigate the complexities of the automotive marketplace with confidence and agility. As companies embrace data-driven decision-making, they position themselves for success in an increasingly competitive and dynamic industry landscape. By harnessing the power of data, the automotive industry can drive forward towards a future defined by innovation, efficiency, and customer-centricity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba70a291fe59" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>