stockmarket pattern detection yolov8
foduucomIntroduction
The YOLOv8s Stock Market Pattern Detection model is an object detection framework developed to identify chart patterns in real-time stock market trading video data. It assists traders and investors by automating pattern analysis for timely decision-making.
Architecture
The YOLOv8s model is based on the YOLO (You Only Look Once) framework, designed for real-time detection of crucial stock market patterns. It integrates advanced bounding box techniques and pattern-specific feature extraction for identifying patterns like 'Head and shoulders bottom', 'Head and shoulders top', 'M_Head', 'StockLine', 'Triangle', and 'W_Bottom'.
Training
The model was trained on a custom dataset comprising 9000 annotated images for training and 800 for validation. It was fine-tuned using a Jupyter Notebook environment and optimized for minimal detection loss over multiple epochs. Metrics include a mean Average Precision (mAP) score of 0.932 for all patterns. Training was conducted using an NVIDIA GeForce RTX 3080 card.
Guide: Running Locally
-
Install Dependencies
- Use the following command to install the required packages:
pip install ultralyticsplus==0.0.28 ultralytics==8.0.43
- Use the following command to install the required packages:
-
Load Model and Video
- Load the model and set parameters for confidence and IoU thresholds.
- Open and process video files using OpenCV.
-
Perform Real-Time Detection
- Execute YOLOv8 inference on video frames and visualize results.
-
Cloud GPUs
- For optimized performance, consider using cloud GPU services such as Google Cloud or AWS.
from ultralyticsplus import YOLO, render_result
import cv2
# Load model
model = YOLO('foduucom/stockmarket-pattern-detection-yolov8')
# Set parameters
model.overrides['conf'] = 0.25
model.overrides['iou'] = 0.45
# Initialize video capture
video_path = "path/to/your/video/file.mp4"
cap = cv2.VideoCapture(video_path)
# Process video frames
while cap.isOpened():
success, frame = cap.read()
if success:
results = model(frame)
annotated_frame = results[0].plot()
cv2.imshow("YOLOv8 Inference", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
else:
break
cap.release()
cv2.destroyAllWindows()
License
For inquiries regarding licensing and collaboration, please contact FODUU AI at info@foduu.com.