Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download worker refactor #288

Merged
merged 35 commits into from
Jan 27, 2024

Conversation

MattUnderscoreZhang
Copy link
Contributor

Unifies SubsetWorker and DownloadWorker logic.
The two classes can probably be combined at this point.

Merge after #287.

@MattUnderscoreZhang MattUnderscoreZhang changed the title Download worker refactoring Download worker refactor Jan 24, 2024
This was referenced Jan 24, 2024
@rom1504
Copy link
Collaborator

rom1504 commented Jan 25, 2024

Can you rebase please ?

@MattUnderscoreZhang
Copy link
Contributor Author

Ok, done

@MattUnderscoreZhang
Copy link
Contributor Author

MattUnderscoreZhang commented Jan 26, 2024

To describe high-level what happened here, I took overlapping logic from subset_worker and download_worker, and moved them to a common file worker.py. I did try to fully combine the two workers into a single class, but was unable to do so right now due to differences in how they load input data.

The main reason I did this was because both workers use the video processing subsamplers, which I'm trying to rewrite to not use temp file read/writes. By putting the common video processing logic in a single file, I can reduce the number of changes I have to track later.

I have tested both subset_worker and download_worker on a subset of webvid, using my usual workflow with a framerate resampling, resizing, cropping, padding, clip finding, and cutting. I did this both as a single-step download+process, and with a download + subsequent process. Both methods replicated previous results, showing that this refactor should have no functional effect.

@rom1504
Copy link
Collaborator

rom1504 commented Jan 27, 2024

looks pretty good to me, let's merge

@rom1504 rom1504 merged commit 83afef0 into iejMac:main Jan 27, 2024
2 checks passed
rom1504 added a commit that referenced this pull request Feb 8, 2024
* ClippingSubsampler rewrite and bug fixes

* More refactoring of ClippingSubsampler, plus a fix to _get_clip_intervals

* Finished refactoring ClippingSubsampler

* Final code changes

* Added docstrings

* Passed tests and linting

* Made type annotations consistent with Python 3.8

* More annotation fixes

* The Python 3.8 annotation needs a lot of hand-holding, it seems

* Pylint has to cut it out, I swear to God

* No real change, just relauching unit tests which failed due to connection timeouts

* Linting issue

* Another linting issue

* Separated per-shard code from code that should only be executed once

* Pulled ShardStatus parameters into their own data type

* Cleaned up shard processing error handling

* Cleaned up code

* Bug fixes

* Formatting

* Fixed linting issues

* Fixing more damn linting

* Added a missing docstring

* Unified SubsetWorker and DownloadWorker code

* Bug fixes

* Linting

* Linting again

* Forgot a docstring

* Removed unnecessary manual thread handling

* Removed unused import

---------

Co-authored-by: iejMac <kilianmaciej6@gmail.com>
Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
rom1504 added a commit that referenced this pull request Feb 8, 2024
rom1504 added a commit that referenced this pull request Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants