Giter Club home page Giter Club logo

d-jobs_24_02's Introduction

D-Jobs_24_02

D-Jobs 아카데미 2기 파이썬 / 인공지능 강의 자료

d-jobs_24_02's People

Contributors

hykanginfinyx avatar kanghoyong avatar

Watchers

 avatar

d-jobs_24_02's Issues

Tracks

from collections import defaultdict
import cv2
import numpy as np
from ultralytics import YOLO

def webcam_play_run(cap, model, track_history):
# Loop through the video frames
while cap.isOpened():
# Read a frame from the webcam
success, frame = cap.read()

    if success:
        result = model.track(frame, persist=True, conf=0.5, iou=0.5)

        # Check if any objects were detected
        if result[0].boxes.cls.numel() > 0:
            # Get the boxes and track IDs
            cls = result[0].boxes.cls.int().cpu().item()
            boxes = result[0].boxes.xywh.cpu()
            track_ids = result[0].boxes.id.int().cpu().tolist()
            name = result[0].names[cls]

            # Visualize the results on the frame
            annotated_frame = result[0].plot()

            # Plot the tracks
            for box, track_id in zip(boxes, track_ids):
                x, y, w, h = box
                track = track_history[track_id]
                track.append((float(x), float(y)))  # x, y center point
                if len(track) > 30:
                    track.pop(0)

                # Draw the tracking lines
                points = np.array(track).astype(np.int32).reshape((-1, 1, 2))
                print("cls number ", cls, "class name", name)
                cv2.polylines(annotated_frame, [points], isClosed=False, color=(230, 230, 230), thickness=10)

            # Display the annotated frame
            cv2.imshow("YOLOv8 Tracking .... ", annotated_frame)
        else:
            # If no objects are detected, just display the frame
            cv2.imshow("YOLOv8 Tracking .... ", frame)

        # Break the loop if 'q' is pressed
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    else:
        break

if name == "main":
# Load the YOLOv8 model
model = YOLO("yolov8n.pt")

cap = cv2.VideoCapture(0)  # webcam device : 0

# Store the track history
track_history = defaultdict(lambda: [])

webcam_play_run(cap=cap, model=model, track_history=track_history)

오디오 Classification 코드 오류 해결 방법

오류 내용 (데이터 다운로드 후 체크섬에 의해서 데이터 체크 하는 중에 문제 발생)
datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=8467781,
num_examples=51094, shard_lengths=None, dataset_name=None), 'recorded': SplitInfo(name='train', num_bytes=21073497,
num_examples=64727, shard_lengths=None, dataset_name='superb')}]

해결 방법 : dataset = load_dataset("superb", "ks", ignore_verifications=True)
--> ignore_verifications = True 설정 : 체크섬, 크기 분할 확인을 무시

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.