Hi
Saturday, 16 March 2024
Text to Vector , Preprocessing and Loading to mode
Print Tensorflow version
Hi
Try this
import tensorflow as tf print(tf.__version__) import keras print(keras.__version__)
Tuesday, 12 March 2024
How Flask file shows templates and images
Hi
Normal Flask code look like
--------------
from flask import Flask, redirect, url_for, requestapp = Flask(__name__)@app.route('/success/<name>')def success(name): return 'Hi %s' % name@app.route('/login', methods=['POST', 'GET'])def login(): if request.method == 'POST': user = request.form['name'] return redirect(url_for('success', name=user)) else: user = request.args.get('name') return redirect(url_for('success', name=user))if __name__ == '__main__': app.run(debug=True)--------------
If you need template page, your flask file should return the following code
return render_template('template.html', result=hupresult)
Your template.html should be saved inside templates folder
and the code template.html should look like
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flask Image Example</title>
</head>
<body>
<h1>{{ result }}</h1>
<!-- Display the image from the static folder -->
<img src="{{ url_for('static', filename='bg.jpg') }}" alt="Your Image">
</body>
</html>
The image bg.jpg should be saved inside 'static' folder
Tuesday, 5 March 2024
Face Emotion Detection - Colab
Hi all
Step1 : Open the colab
Step2 : File -> Save a copy in Drive
Step3 : Work with the copy
Link
https://colab.research.google.com/drive/1K-XhE_qW0VLWrPmjycz8kriRYmA77M33?usp=sharing
Face emotion dataset
Hi all
https://drive.google.com/drive/folders/1PaAA1P_5O8bNV42AHxNEHyzmQuMsR3kW?usp=sharing
DIST Google form outputs
Hi all
Please upload these screenshots
1. Python program without ML for sentiment analysis
2. using SET option
3. Using ML for sentiment analysis
4. Graph showing algorithm performance - 7 agorithms
5. Use of Pickle
6. Use of Savemodel
7. Covid data analysis - Using ML for sentiment analysis
8. Deep learning - Face emotion recognition
9. Flask Basics
Monday, 4 March 2024
Show graph in Python for Test accuracy and Train accuracy o various ML algorithms
Hi all,
Please see the code.
import matplotlib.pyplot as plt
import numpy as np
# Example data (replace this with your actual data)
algorithms = ['KNN', 'ANN', 'Decision Tree', 'Ada Boost', 'Random forest', 'Naive Bayes', 'Log Regression']
test_accuracies = [0.85, 0.92, 0.78, 0.88, 0.95, 0.89, 0.91]
train_accuracies = [0.95, 0.97, 0.88, 0.93, 0.98, 0.92, 0.96]
# Set up bar positions
bar_width = 0.35
index = np.arange(len(algorithms))
# Create bar chart
fig, ax = plt.subplots()
bar1 = ax.bar(index, test_accuracies, bar_width, label='Test Accuracy')
bar2 = ax.bar(index + bar_width, train_accuracies, bar_width, label='Train Accuracy')
# Add labels, title, and legend
ax.set_xlabel('Machine Learning Algorithms')
ax.set_ylabel('Accuracy')
ax.set_title('Test and Train Accuracies of Machine Learning Algorithms')
ax.set_xticks(index + bar_width / 2)
ax.set_xticklabels(algorithms)
ax.legend()
# Show the plot
plt.show()
Deploy ML Model using input from user
Hi,
Please find the code
Shared Datasets
Hi,
Please find the shared dataset.
https://drive.google.com/drive/folders/1Ht32d3wP-lIJ4QrZsjQHFwU_hnGal0YI?usp=sharing