Skip to content

Commit

Permalink
Merge pull request #468 from JingyuanZhang/master
Browse files Browse the repository at this point in the history
【fix】解决 detect  模型 multiclass_nms 算子返回空数组问题
  • Loading branch information
yueshuangyan authored Sep 2, 2022
2 parents 9862ffa + 7843fe6 commit b2c0c87
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/paddlejs-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paddlejs/paddlejs-core",
"version": "2.1.28",
"version": "2.2.0",
"description": "",
"main": "lib/index",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/paddlejs-core/src/postOps/multiclass_nms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function compute(inputs, attrs) {
// threshold, sort, slice
const scoresMapList = getMaxScore(scores[i], score_threshold, nms_top_k);
if (!scoresMapList || !scoresMapList.length) {
return [];
continue;
}
const maxScoreMap = scoresMapList.shift();
const maxIndice = maxScoreMap.i;
Expand Down
14 changes: 7 additions & 7 deletions packages/paddlejs-models/humanseg/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/paddlejs-models/humanseg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paddlejs-models/humanseg",
"version": "1.2.2",
"version": "1.2.3",
"description": "",
"main": "lib/index",
"scripts": {
Expand All @@ -10,8 +10,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"@paddlejs/paddlejs-backend-webgl": "^1.1.19",
"@paddlejs/paddlejs-core": "^2.1.17"
"@paddlejs/paddlejs-backend-webgl": "^1.2.9",
"@paddlejs/paddlejs-core": "^2.1.28"
},
"devDependencies": {
"html-webpack-plugin": "^3.2.0",
Expand Down
13 changes: 3 additions & 10 deletions packages/paddlejs-models/humanseg/src/index_gpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ interface LoadOptions {

let runner = null as Runner;

let WIDTH = 398;
let HEIGHT = 224;
const WIDTH = 398;
const HEIGHT = 224;

function registerCustomOp() {
registerOp(segImg, 'segImg');
Expand Down Expand Up @@ -57,14 +57,7 @@ export async function load(options: LoadOptions = {
canvasWidth: 500,
canvasHeight: 280
}) {
const modelpath = 'https://paddlejs.bj.bcebos.com/models/fuse/humanseg/humanseg_398x224_fuse_activation/model.json';
const lightModelPath = 'https://paddlejs.bj.bcebos.com/models/fuse/humanseg/humanseg_288x160_fuse_activation/model.json';
const modelPath = options.enableLightModel ? lightModelPath : modelpath;

if (options.enableLightModel) {
WIDTH = 288;
HEIGHT = 160;
}
const modelPath = 'https://paddlejs.cdn.bcebos.com/models/humansegv2/model.json';

runner = new Runner({
modelPath: modelPath,
Expand Down

0 comments on commit b2c0c87

Please sign in to comment.