-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtest_mosiac.py
39 lines (31 loc) · 1.25 KB
/
test_mosiac.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'''
lanhuage: python
Descripttion:
version: beta
Author: xiaoshuyui
Date: 2020-10-26 08:31:13
LastEditors: xiaoshuyui
LastEditTime: 2020-11-23 10:00:41
'''
import sys
sys.path.append("..")
import os
from skimage import io
from convertmask.utils.auglib.optional.mosaic import mosiac_img, mosiacScript, mosiac_img_no_reshape, mosiacScript_no_reshape
BASE_DIR = os.path.abspath(os.path.dirname(os.getcwd())) + os.sep + 'static'
if __name__ == "__main__":
BASE_DIR = os.path.abspath(os.path.dirname(
os.getcwd())) + os.sep + 'static'
imgPath = BASE_DIR + os.sep + 'testMosiac.jpg'
xmlPath = BASE_DIR + os.sep + 'multi_objs.xml'
oriImg = io.imread(BASE_DIR + os.sep + 'multi_objs.jpg')
# mosicImg = mosiac_img([oriImg,],heightFactor=0.7,widthFactor=0.3)
# io.imsave(imgPath,mosicImg)
# mosiacScript([oriImg,],[xmlPath,],BASE_DIR,True)
# mosicImg, _ = mosiac_img_no_reshape([oriImg, oriImg, oriImg, oriImg],
# heightFactor=0.4,
# widthFactor=0.3)
# io.imsave(imgPath, mosicImg)
mosiacScript_no_reshape([oriImg, oriImg, oriImg, oriImg],
[xmlPath, xmlPath, xmlPath, xmlPath], BASE_DIR,
True)