1

i run this simple code but it give me error

import pixellib
from pixellib.semantic import semantic_segmentation

segment_video = semantic_segmentation()
segment_video.load_ade20k_model("/content/drive/MyDrive/yolo/deeplabv3_xception65_ade20k.h5")
segment_video.process_video_ade20k("/content/drive/MyDrive/yolo/Traffic-21438.mp4", frames_per_second= 15, output_video_name="/content/drive/MyDrive/yolo/")

Error : local variable 'raw_labels' referenced before assignment

1 Answers1

0

This is most due to your source video URL not being correct. OpenCV does not return an error if the video URL is not loaded due to a file not found (in line 197 of semantic.py). I recommend double checking the path exists with a print('does the file exist:', os.path.exists(video_path)) line within def process_video_pascalvoc() in semantic.py. Fixing my file URL fixed this error for me