12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- from paddlers.deploy import Predictor
- import numpy as np
- from PIL import Image
- import uuid
- predictor = Predictor("inference_model/change", use_gpu=True)
- def change_detect(image1,image2,outputPath):
-
-
-
-
-
-
-
-
-
-
-
- res = predictor.predict((image1, image2))
-
-
-
-
-
-
- cm = res['label_map']
-
- change_map_image = Image.fromarray(np.uint8(cm * 255), 'L')
-
-
-
-
-
- savePath = outputPath+str(uuid.uuid4())+'.png'
-
- change_map_image.save(savePath)
-
-
-
-
-
- return savePath
- start(r'E:\big_model\tuban\ceshi\A\1001.tif',r'E:\big_model\tuban\ceshi\B\1001.tif','E:/PaddleRS/predict/output/')
|