WisconsinAIVision / WisconsinAIVision/UniversalFakeDetect
BUG: --result_folder Deletion
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 378
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
Description
The --result_folder deletes previous folder without warning.
if os.path.exists(opt.result_folder):
shutil.rmtree(opt.result_folder)
os.makedirs(opt.result_folder)
So if you happen to want to save your results in the same folder as your checkpoint weights, you delete it instead. This is incredibly risky behavior.
Recommendation
Confirm deletion before doing so with:
if os.path.exists(opt.result_folder):
print(f"About to delete: {opt.result_folder}")
input("Press Enter to confirm...")
shutil.rmtree(opt.result_folder)
os.makedirs(opt.result_folder)
OR, just don't delete the folder in the first place.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the project for opt.result_folder and inspect the surrounding command-line setup and folder handling. Reproduce the existing deletion behavior, then verify that an existing result folder is no longer removed without the intended safe handling and that new result folders still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100