-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Mood & Enhanced Speech Classifications
- Loading branch information
1 parent
da79550
commit 98dd2bc
Showing
20 changed files
with
1,718 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"# AI Multitask Classifiers: From Objects to Emotions\n", | ||
"\n", | ||
"## Introduction\n", | ||
"This Jupyter notebook showcases the AI Multitask Classifiers project, which includes various classifiers for object detection, face detection, character recognition, and more, using frameworks like OpenCV, TensorFlow, and PyTorch.\n", | ||
"\n", | ||
"## Setup\n", | ||
"First, ensure you have all required libraries installed:\n", | ||
"```\n", | ||
"```python\n", | ||
"!pip install numpy opencv-python tensorflow pytorch pytesseract\n", | ||
"```\n", | ||
"\n", | ||
"### Loading Models\n", | ||
"Here, we load the models for each classification task. Replace `'model_path'` with the actual paths to your models.\n", | ||
"\n", | ||
"#### Object Detection (YOLO)\n", | ||
"```python\n", | ||
"import cv2\n", | ||
"yolo_model = cv2.dnn.readNetFromDarknet('yolov3.cfg', 'yolov3.weights')\n", | ||
"```\n", | ||
"\n", | ||
"#### Face Detection (TensorFlow)\n", | ||
"```python\n", | ||
"import tensorflow as tf\n", | ||
"tf_model = tf.keras.models.load_model('model_path')\n", | ||
"```\n", | ||
"\n", | ||
"#### Mood Classification (PyTorch)\n", | ||
"```python\n", | ||
"import torch\n", | ||
"torch_model = torch.load('model_path')\n", | ||
"```\n", | ||
"\n", | ||
"### Running Classifications\n", | ||
"Demonstrate how to use these models to classify images.\n", | ||
"\n", | ||
"#### Object Detection with YOLO\n", | ||
"```python\n", | ||
"def detect_objects_yolo(image_path, model):\n", | ||
" # Image loading and processing for YOLO\n", | ||
" return image\n", | ||
"\n", | ||
"yolo_result = detect_objects_yolo('path/to/object/image.jpg', yolo_model)\n", | ||
"```\n", | ||
"\n", | ||
"#### Face Detection with TensorFlow\n", | ||
"```python\n", | ||
"def detect_faces_tf(image_path, model):\n", | ||
" # Image loading and processing for TensorFlow\n", | ||
" return predictions\n", | ||
"\n", | ||
"tf_result = detect_faces_tf('path/to/face/image.jpg', tf_model)\n", | ||
"```\n", | ||
"\n", | ||
"#### Mood Classification with PyTorch\n", | ||
"```python\n", | ||
"def classify_mood_torch(image_path, model):\n", | ||
" # Image loading and processing for PyTorch\n", | ||
" return predictions\n", | ||
"\n", | ||
"torch_result = classify_mood_torch('path/to/mood/image.jpg', torch_model)\n", | ||
"```\n", | ||
"\n", | ||
"### Results and Analysis\n", | ||
"Discuss and display the results.\n", | ||
"\n", | ||
"#### YOLO Object Detection\n", | ||
"```python\n", | ||
"# Displaying YOLO results\n", | ||
"```\n", | ||
"\n", | ||
"#### TensorFlow Face Detection\n", | ||
"```python\n", | ||
"# Displaying TensorFlow results\n", | ||
"```\n", | ||
"\n", | ||
"#### PyTorch Mood Classification\n", | ||
"```python\n", | ||
"# Displaying PyTorch results\n", | ||
"```\n", | ||
"\n", | ||
"### More Classifiers\n", | ||
"For each additional classifier mentioned in the README, add similar sections as above. For example, Character Recognition (OCR), Animal Classification, etc.\n", | ||
"\n", | ||
"#### Character Recognition (OCR)\n", | ||
"```python\n", | ||
"# Load OCR model, demonstrate character recognition\n", | ||
"```\n", | ||
"\n", | ||
"#### Animal Classification\n", | ||
"```python\n", | ||
"# Load animal classification model, demonstrate usage\n", | ||
"```\n", | ||
"\n", | ||
"### Speech Recognition\n", | ||
"```python\n", | ||
"# Discuss the speech recognition module, demonstrate usage\n", | ||
"```\n", | ||
"\n", | ||
"## Conclusion\n", | ||
"Summarize the capabilities and findings of using these classifiers.\n", | ||
"\n", | ||
"## Future Work\n", | ||
"- Enhance the models and expand the notebook with more detailed examples and analyses.\n", | ||
"- Incorporate feedback and new classifiers as the project evolves.\n" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"id": "e6141e55235e57c3" | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 2 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython2", | ||
"version": "2.7.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.8-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /usr/src/app | ||
|
||
# Copy the current directory contents into the container at /usr/src/app | ||
COPY . . | ||
|
||
# Install any needed packages specified in requirements.txt | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Make port 80 available to the world outside this container | ||
EXPOSE 80 | ||
|
||
# Define environment variable | ||
ENV NAME AI-Classifiers | ||
|
||
# Run app.py when the container launches | ||
CMD ["python", "./main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
setup: | ||
python3 -m venv venv | ||
. venv/bin/activate; pip install -r requirements.txt | ||
|
||
run: | ||
python3 main.py | ||
|
||
test: | ||
python3 -m unittest discover -s tests | ||
|
||
docker-build: | ||
docker build -t ai-classifier . | ||
|
||
docker-run: | ||
docker run -p 5000:80 ai-classifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
opencv-python = "*" | ||
tensorflow = "*" | ||
torch = "*" | ||
torchvision = "*" | ||
numpy = "*" | ||
scipy = "*" | ||
matplotlib = "*" | ||
pandas = "*" | ||
scikit-learn = "*" | ||
pytesseract = "*" | ||
speechrecognition = "*" | ||
pyaudio = "*" | ||
|
||
[requires] | ||
python_version = "3.8" |
Oops, something went wrong.