1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- from paddlers.deploy import Predictor
- import numpy as np
- from PIL import Image
- import uuid
- predictor = Predictor("inference_model_change", use_gpu=True)
- def start(image1,image2):
-
-
-
-
-
-
-
-
-
-
-
- res = predictor.predict((image1, image2))
-
-
-
-
-
-
- cm = res['label_map']
-
- change_map_image = Image.fromarray(np.uint8(cm * 255), 'L')
-
-
-
-
-
- savePath = 'predict/'+str(uuid.uuid4())+'.png'
-
- change_map_image.save(savePath)
-
-
-
-
-
- return savePath
|