-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] 前端实现场景分类功能 & [Style] 规范代码风格 (#21)
* 9.24更新 (#5) * 新增场景分类功能 * 1.修复绘制目标框不准确的bug 2.修复图像偏色问题 3.将目标框颜色改为更显眼的紫色 * 修改滑窗步长,加快推理速度 * 1.修改场景分类读取图像的接口,改用paddelrs中的decode_image 2.修改地物分类结果图像的颜色显示 3.去除地物分类任务中的冗余代码 * 删除地物分类中冗余代码 * 1.修改错误函数名(批量处理) 2.删除渲染函数中冗余代码 3.改用cv2统一对图像进行操作处理,去除skimage的引用 * 场景分类功能的前端实现 1. 前端实现场景分类功能 2. 移除不必要的依赖,使得CI可以在Node.js 16.x下通过 * 绘制图片时colormap自动生成,便于适配用户自定义模型 * 绘制图片时colormap自动生成,便于适配用户自定义模型 * 修改可能产生误导的注释 Co-authored-by: Terayco <78073130+terayco@users.noreply.github.com> Co-authored-by: yibaikuai <90198481+yibaikuai@users.noreply.github.com>
- Loading branch information
1 parent
be80ceb
commit 57f8da6
Showing
32 changed files
with
636 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
# 导入需要用到的库 | ||
import os.path as osp | ||
|
||
import cv2 | ||
import paddlers as pdrs | ||
|
||
|
||
def read_rgb(path): | ||
im = cv2.imread(path) | ||
im = im[..., ::-1] | ||
return im | ||
from paddlers.transforms import decode_image | ||
|
||
|
||
def execute(model_path, data_path, names): | ||
image_list = [osp.join(data_path, name) for name in names] | ||
ims = [read_rgb(i) for i in image_list] | ||
ims = [decode_image(i) for i in image_list] | ||
predictor = pdrs.deploy.Predictor(model_path, use_gpu=True) | ||
temps = predictor.predict(ims) | ||
return temps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.