|
@@ -64,7 +64,7 @@ def find_image_and_convert_to_base64(image_path):
|
|
|
return image_base64
|
|
|
|
|
|
def upload_image_to_anvil(row_id, image_base64):
|
|
|
- url = "{}/tasks/ai-image/upload-image".format(api_path)
|
|
|
+ url = "{}/test-3".format(api_path)
|
|
|
payload = {"row_id": row_id, "image_base64": image_base64}
|
|
|
response = requests.post(url, json=payload)
|
|
|
if response.status_code == 200:
|
|
@@ -216,9 +216,8 @@ def get_images(ws, prompt):
|
|
|
|
|
|
def main(*args):
|
|
|
|
|
|
- deadlinePlugin = args[0]
|
|
|
- job = deadlinePlugin.GetJob()
|
|
|
- row_id = job.JobExtraInfo0
|
|
|
+
|
|
|
+
|
|
|
|
|
|
argv = sys.argv
|
|
|
|
|
@@ -228,6 +227,8 @@ def main(*args):
|
|
|
|
|
|
ai_scene_info = convert_base64_string_to_object(argv[0])
|
|
|
|
|
|
+ row_id = ai_scene_info["image_id"]
|
|
|
+
|
|
|
print("loading scene data", ai_scene_info)
|
|
|
|
|
|
except Exception as e:
|
|
@@ -255,28 +256,16 @@ def main(*args):
|
|
|
|
|
|
project_id = data["project_id"]
|
|
|
|
|
|
+ complete_image_path = image_path + "{}/{}".format(project_id,image_info['filename'])
|
|
|
+ print(complete_image_path)
|
|
|
+
|
|
|
image_base64 = find_image_and_convert_to_base64(
|
|
|
image_path + "{}/{}".format(project_id,image_info['filename'])
|
|
|
)
|
|
|
upload_image_to_anvil(row_id, image_base64)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- #Commented out code to display the output images:
|
|
|
-
|
|
|
- # for node_id in images:
|
|
|
- # for image_data in images[node_id]:
|
|
|
-
|
|
|
- # image = Image.open(io.BytesIO(image_data))
|
|
|
- # image.show()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
- main()
|
|
|
+ main(sys.argv)
|
|
|
|
|
|
|