The Problem
Developers who need quick, hands‑on examples of deep‑learning models often copy notebook snippets, but they lack a ready‑to‑run reference that demonstrates both classic image classification (MNIST) and modern object detection (YOLOv7). This repository fills that gap with two self‑contained Jupyter notebooks.
What This Does
MNIST_Neural_networks.ipynb builds a three‑layer dense network (128 → 64 → 16 units) using Keras, trains it on the MNIST digit set, and prints the final test accuracy. Object_Detection_using_YOLOv7.ipynb loads a pre‑trained YOLOv7 model (PyTorch) and runs inference on sample images, visualising bounding boxes. The accompanying README.md documents the MNIST workflow and lists the high‑level architecture of the network.
How It Is Wired
Execution begins when a user opens a notebook in Jupyter (or VS Code’s notebook UI) and runs the cells sequentially.
- MNIST notebook – 1. Imports
tensorflow.kerasandnumpy. 2. Callsload_data()from Keras to fetch the MNIST split. 3. Constructs the model withSequential([...])and compiles it (optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy']). 4. Triggers training viamodel.fit(...). 5. Evaluates withmodel.evaluate(...)and prints the accuracy. The notebook owns the entire lifecycle: data loading, model definition, training, and evaluation. No external scripts are invoked.
- YOLOv7 notebook – 1. Imports
torchand the YOLOv7 helper utilities (e.g.,attempt_load,non_max_suppression). 2. Loads a checkpoint file (yolov7.pt) usingattempt_load. 3. Reads an image withcv2.imread, converts it to a tensor, and runsmodel(img_tensor). 4. Applies NMS and draws boxes with OpenCV functions. All steps occur within the notebook; the only external artifact is the.ptweight file, which the notebook expects to be present in the working directory.
There is no shared module graph between the two notebooks; each operates independently. Consequently, the “blast radius” of any change is limited to the notebook in which the modification occurs.
How To Use It
# Clone the repository
git clone https://github.com/moses-y/Neural-Networks
cd Neural-Networks
# (Optional) Create a virtual environment
python -m venv venv && source venv/bin/activate
# Install core dependencies – the notebooks import TensorFlow/Keras and PyTorch.
pip install tensorflow torch torchvision opencv-python matplotlib
- Launch Jupyter:
jupyter notebook(orjupyter lab). - Open
MNIST_Neural_networks.ipynband run all cells to reproduce the digit‑classification result. - Open
Object_Detection_using_YOLOv7.ipynb, place a YOLOv7 checkpoint namedyolov7.ptin the repository root, then run all cells to see object detection on the supplied images.
No configuration files, environment variables, or command‑line interfaces are defined in the repo.
Real‑World Use
A data‑science team could drop MNIST_Neural_networks.ipynb into a teaching curriculum to illustrate model construction, then switch to Object_Detection_using_YOLOv7.ipynb for a quick proof‑of‑concept on custom images:
# In a production script, you might replace the notebook steps with:
model = tf.keras.models.load_model('mnist_model.h5')
pred = model.predict(new_image.reshape(1,28,28,1))
Code Health & Issues
- Med – No test files detected – repository-wide (root).
- Med – No CI/CD pipeline detected – no
.github/workflows or other CI configs. - Med – No LICENSE file – unclear redistribution rights (root).
- Info – No Dockerfile, lockfile, or committed secrets – repository hygiene check reports none.
These findings are produced by static analysis; no additional issues were observed.
The Bottom Line
The repo delivers two runnable notebooks that demonstrate a basic MNIST classifier and a YOLOv7 detector, useful for learning or quick prototyping. It lacks any production‑grade scaffolding—no tests, CI, or licensing—so it is best suited for educational or experimental contexts rather than deployment‑critical projects.