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

added file path picker for ease of use #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cocoviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,22 @@ def print_info(message: str):
def main():
print_info("Starting...")
args = parser.parse_args()

if not args.images:
messagebox.showwarning("Warning!", "Nothing to show.\nPlease specify a path to the Images!")
# Show the open file dialog by specifying path
args.images = filedialog.askdirectory()

if not args.annotations:
messagebox.showwarning("Warning!", "Nothing to show.\nPlease specify a path to the Annotations!")
# Specify the file types
filetypes = (('JSON files', '*.json'), ("All files", "*.*"))
# Show the open file dialog by specifying path
args.annotations = filedialog.askopenfilename(filetypes=filetypes)

print_info(f"Image Path: {args.images}")
print_info(f"Annotations Path: {args.annotations}")

root = tk.Tk()
root.title("COCO Viewer")

Expand Down