gpt-4o-2024-05-13· OpenAI
WildChat-4.8M (AI2)
i want to open the response image and show next to the original one loadedimage =…
- User
i want to open the response image and show next to the original one
loaded_image = cv2.imread(img_url) image_rgb = cv2.cvtColor(loaded_image, cv2.COLOR_BGR2RGB)
show the image
plt.imshow(image_rgb) plt.axis('off') plt.show()
import requests
url = 'http://localhost:3000/transform/fisheye'
with open(img_url, 'rb') as file: files = {'image': file} data = {'message': ""} response = requests.post(url, files=files, data=data)
codeif response.status_code == 200: with open('image_test_undistorted.jpeg', 'wb') as f: f.write(response.content) print('Success! Image saved as image_test_undistorted.jpeg') else: print('Fail saving image. Status Code:', response.status_code)print("Done.")
- Assistant