smacke / smacke/ffsubsync

Subsync erroring out with "max() arg is an empty sequence".

Open
#60 8 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
7.9k
Forks
323
PR merge metrics
No merged PRs in 30d

Description

Environment (please complete the following information):

  • OS: Ubuntu 18.04 LTS
  • python version: Python 2.7.17
  • subsync version: subsync 0.3.4

Describe the bug
The sync process fails with an error ValueError: max() arg is an empty sequence

To Reproduce
subsync "vid.mp4" -i sub1.srt -o sub2.srt

Expected behavior
The process should succeed.

Output

INFO:subsync.subsync:extracting speech segments from reference 'vid.mp4'...
INFO:subsync.speech_transformers:Checking video for subtitles stream...
INFO:subsync.speech_transformers:Video file appears to lack subtitle stream
100%|█████████▉| 7687.72266667/7687.723 [01:33<00:00, 81.91it/s]
INFO:subsync.subsync:...done
INFO:subsync.subsync:extracting speech segments from subtitles 'sub1.srt'...
INFO:subsync.subtitle_parser:detected encoding: UTF-8
INFO:subsync.subsync:...done
INFO:subsync.subsync:computing alignments...
Traceback (most recent call last):
  File "/home/user/.local/bin/subsync", line 11, in <module>
    load_entry_point('subsync==0.3.4', 'console_scripts', 'subsync')()
  File "/home/user/.local/lib/python2.7/site-packages/subsync/subsync.py", line 207, in main
    return run(args)
  File "/home/user/.local/lib/python2.7/site-packages/subsync/subsync.py", line 106, in run
    srt_pipes,
  File "/home/user/.local/lib/python2.7/site-packages/sklearn/base.py", line 467, in fit_transform
    return self.fit(X, y, **fit_params).transform(X)
  File "/home/user/.local/lib/python2.7/site-packages/subsync/aligners.py", line 77, in transform
    (score, offset), subpipe = max(scores)
ValueError: max() arg is an empty sequence

Test case
vid.zip

Additional context
--

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The failure is raised in subsync/aligners.py at line 77 during the sklearn fit_transform path; start there and reproduce with the command and attached vid.zip. Confirm the same input no longer aborts during computing alignments and that the expected output subtitle file is produced.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, scikit-learn
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.