from matplotlib import image
from matplotlib import pyplot as plt
from matplotlib import patches

import json

working_directory = '/'
  
# to read the image stored in the working directory
data = image.imread(working_directory + '1.jpg')

# Read the json file stored in the working directory
with open(working_directory + 'jsonformatter.txt') as f:
    json_data = json.load(f)

figure, ax = pyplot.subplots(1)
ax.imshow(img)

for person in json_data:
	if person["image_id"] == "1.jpg":
		keypoints = person["keypoints"]
		box = person["box"]
		rect = patches.Rectangle((box[0], box[1]), box[2], box[3], edgecolor='r', facecolor="none")
		ax.add_patch(rect)
		for i in range(0, len(keypoints), 3):
			x,y = keypoints[i], keypoints[i+1]
			circle = patches.Circle(x,y,1)
			ax.add_patch(circled)


from matplotlib import image
from matplotlib import pyplot as plt
from matplotlib import patches

import json

working_directory = '/'
  
# to read the image stored in the working directory
data = image.imread(working_directory + '1.jpg')

# Read the json file stored in the working directory
with open(working_directory + 'jsonformatter.txt') as f:
    json_data = json.load(f)

figure, ax = pyplot.subplots(1)
ax.imshow(img)

for person in json_data:
	if person["image_id"] == "1.jpg":
		keypoints = person["keypoints"]
		box = person["box"]
		rect = patches.Rectangle((box[0], box[1]), box[2], box[3], edgecolor='r', facecolor="none")
		ax.add_patch(rect)
		for i in range(0, len(keypoints), 3):
			x,y = keypoints[i], keypoints[i+1]
			circle = patches.Circle(x,y,1)
			ax.add_patch(circled)


# to read the image stored in the working directory # Read the json file stored in the working directory