Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problem saving to output directory
When images were open using a full filepath (either specified from the command line or from the dialogue that pops up in response to the "Open" or "Open Dir" QT buttons), they were not saved in the location that the user specified. Instead, they were being saved in the same directory as the image. This bug was caused by how Python's os.path.join() function handles full file paths given as the second argument. For example, os.path.join('first/path', '/second/full/path') will just return '/second/full/path'. To recreate this problem, run "labelme --output path/to/output/directory --autosave /full/path/to/image.jpg" without the fix. Create a polygon on the image and click save. Notice that the save dialog opens up to "/full/path/to/". Even if you go to File->Change Output Dir and select a directory, the save dialog still opens up to "/full/path/to/". If you apply this fix and then repeat these steps, now the save dialog opens up to "--output path/to/output/directory". The same problem occurred when the "--autosave" flag was used. But this fix corrects this problem as well.
- Loading branch information