This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tkinter as tk | |
| # Function to handle button clicks | |
| def button_click(event): | |
| current = entry.get() | |
| text = event.widget.cget("text") | |
| if text == "=": | |
| try: | |
| result = eval(current) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def annotate_image(image): | |
| # Create a copy of the image to draw annotations on | |
| annotated_image = image.copy() | |
| # Create lists to store the annotated points and boxes | |
| points = [] | |
| boxes = [] | |
| point_labels = [] | |
| unscaled_points = [] # To store unscaled points | |
| unscaled_boxes = [] # To store unscaled boxes |