Comments (1)
文章中说“The text background is obtained from DIV2K [1] and Flick2K [59] datasets, in which each image is randomly cropped and upsampled to ×4 ∼16 to synthesize the complex background”,代码中实现的似乎与文章不符,代码中的逻辑也不大理解,可以麻烦稍微介绍一下代码逻辑吗~
for split in SplitNames: fis = os.listdir(osp.join(TestImgPath, split)) for fi in fis: KeyLists = os.listdir(osp.join(TestImgPath, split, fi)) for key in KeyLists: ImgLists = os.listdir(osp.join(TestImgPath, split, fi, key)) for ImgName in ImgLists: ImgPath = osp.join(TestImgPath, split, fi, key, ImgName) A = Image.open(ImgPath).convert('RGB') w,h = A.size print([split,fi,key,ImgName]) for ss in ScaleLists: new_w = w*ss//10 new_h = h*ss//10 if ss < ScaleLists[0]: A = A.resize((new_w, new_h), Image.LANCZOS) HowmanyEach = min(new_w//CropSize, new_h//CropSize) * 2 * 2 for j in range(HowmanyEach): _, Crop, V, M = GetHighPatch(A, CropSize) total = total + 1 SaveName = '{}_{}_{}_{}_{:05d}_{:02d}.png'.format(split, fi, key, ImgName[:-4],j,ss) Crop.save(os.path.join(SavePath, SaveName))
crop_DF2K.py 这个文件只是将DF2K图像裁剪成图像块,对应的是‘The text background is obtained from DIV2K [1] and Flick2K [59] datasets, in which each image is randomly cropped’,
后面的’upsampled to ×4 ∼16 to synthesize the complex background‘ 是在读取训练数据时用到的,参考
from marconet.
Related Issues (20)
- name 'fused_act_ext' is not defined HOT 2
- 测试的时候会有这个问题 HOT 1
- error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor' HOT 1
- 请问验证集是啥?训练过程中发现验证集没给,没有评估指标的保存? HOT 2
- ModuleNotFoundError: No module named 'tspgan' HOT 1
- Please tell me how to solve this problem HOT 11
- Hello, can this be used in English? textbsr doesn't work very well for English. HOT 13
- 关于裁剪图像 HOT 1
- Multi-GPU training HOT 3
- NameError: name 'fused_act_ext' is not defined HOT 4
- use_new_bbox HOT 5
- Training model for English Data HOT 1
- 可以输出预测结果,但没法保存图片,会报错:Error in syn_lq04 HOT 7
- 训练代码? HOT 1
- Encountered error while generating package metadata. HOT 1
- Train the model from scratch HOT 2
- Can you provide training data generation code? HOT 2
- NameError: name 'fused_act_ext' is not defined HOT 1
- How to prepare the dataset? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marconet.