Could not open video at /content/subway.mp4

Aperta
#267 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
jupyter-notebook, opencv, python

Direzione di ricerca

Apri how-to-detect-and-count-objects-in-polygon-zone.ipynb e ispeziona SUBWAY_VIDEO_PATH nel punto in cui viene chiamato get_video_frames_generator. Riproduci l’estrazione dei frame che non riesce in Google Colab e verifica l’asset subway.mp4 e il percorso a cui si fa riferimento; il lavoro è completato quando viene caricato il primo frame e viene eseguita la cella di rilevamento successiva.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Search before asking
  • I have searched the Roboflow Notebooks issues and found no similar bug report.
Notebook name

how-to-detect-and-count-objects-in-polygon-zone.ipynb

Bug
Exception                                 Traceback (most recent call last)
[<ipython-input-27-ef352d094252>](https://localhost:8080/#) in <cell line: 6>()
      4 generator = sv.get_video_frames_generator(SUBWAY_VIDEO_PATH)
      5 iterator = iter(generator)
----> 6 frame = next(iterator)
      7 
      8 # detect

[/usr/local/lib/python3.10/dist-packages/supervision/video.py](https://localhost:8080/#) in get_video_frames_generator(source_path)
    118     video = cv2.VideoCapture(source_path)
    119     if not video.isOpened():
--> 120         raise Exception(f"Could not open video at {source_path}")
    121     success, frame = video.read()
    122     while success:

Exception: Could not open video at /content/subway.mp4
Environment
  • Google colab
Minimal Reproducible Example
import supervision as sv

# extract video frame
generator = sv.get_video_frames_generator(SUBWAY_VIDEO_PATH)
iterator = iter(generator)
frame = next(iterator)

# detect
outputs = predictor(frame)
detections = sv.Detections(
    xyxy=outputs["instances"].pred_boxes.tensor.cpu().numpy(),
    confidence=outputs["instances"].scores.cpu().numpy(),
    class_id=outputs["instances"].pred_classes.cpu().numpy().astype(int)
)

# annotate
box_annotator = sv.BoxAnnotator(thickness=4, text_thickness=4, text_scale=2)
frame = box_annotator.annotate(scene=frame, detections=detections)

%matplotlib inline  
sv.show_frame_in_notebook(frame, (16, 16))
Additional

the file subway.mp4 is a Invalidation file .

Are you willing to submit a PR?
  • Yes I'd like to help by submitting a PR!
Lingua principale
Jupyter Notebook
Stelle
9.7k
Fork
1.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di roboflow/notebooks

Tutte le issue di roboflow/notebooks

Issue simili

Altre issue su Computer Vision

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.