#!/usr/bin/env python # coding: utf-8 # In[1]: from PIL import Image from fall_prediction import Fall_prediction import matplotlib.pyplot as plt # ## For Two Images # In[2]: img1 = Image.open("Images/fall_img_1.png") img2 = Image.open("Images/fall_img_2.png") # In[3]: fig = plt.figure(figsize=(10, 7)) fig.add_subplot(1, 2, 1) plt.imshow(img1) plt.title("Image at time t") plt.axis("off") fig.add_subplot(1, 2, 2) plt.imshow(img2) plt.title("Image at time t+1 ") plt.axis("off") plt.show() # In[4]: response = Fall_prediction(img1,img2) if response: print("There is", response['category']) print("Confidence :", response['confidence']) print("Angle : ", response['angle']) print("Keypoint_corr :", response['keypoint_corr']) else: print("There is no fall detetcion...") # ## For Three Images # In[5]: img1 = Image.open("Images/fall_img_1.png") img2 = Image.open("Images/fall_img_2.png") img3 = Image.open("Images/fall_img_3.png") # In[6]: fig = plt.figure(figsize=(12,12)) fig.add_subplot(1, 3, 1) plt.imshow(img1) plt.title("image at time t") plt.axis("off") fig.add_subplot(1, 3, 2) plt.imshow(img2) plt.title("image at time t+1") plt.axis("off") fig.add_subplot(1, 3, 3) plt.imshow(img3) plt.title("image at time t+2") plt.axis("off") plt.show() # In[7]: response = Fall_prediction(img1,img2,img3) if response: print("There is", response['category']) print("Confidence :", response['confidence']) print("Angle : ", response['angle']) print("Keypoint_corr :", response['keypoint_corr']) else: print("There is no fall detetcion...") # In[ ]: