alibaba

alibaba

Alibaba Open Source

Member Since 9 years ago

Hangzhou, China

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
389
repos
Activity
Nov
28
14 hours ago
Activity icon
fork

tinys forked alibaba/designable

⚡ 🧩 Make everything designable 🧩
tinys MIT License Updated
fork time in 1 hour ago
started
started time in 1 hour ago
started
started time in 1 hour ago
started
started time in 1 hour ago
Activity icon
created tag
createdAt 1 hour ago
Activity icon
fork

oceanlvr forked alibaba/formily

⚡ Alibaba Group Unified Form Solution -- Support React/ReactNative/Vue2/Vue3
oceanlvr MIT License Updated
fork time in 1 hour ago
Activity icon
fork

calappidae forked alibaba/p3c

⚡ Alibaba Java Coding Guidelines pmd implements and IDE plugin
calappidae Apache License 2.0 Updated
fork time in 1 hour ago
started
started time in 1 hour ago
push

janryWang push alibaba/formily

janryWang
janryWang

docs(react): fix the typo on ISchemaFieldProps (#2528)

commit sha: 0c5c6f1ed49a58f31a23d4bd9799d7f533278d3e

push time in 2 hours ago
pull request

janryWang pull request alibaba/formily

janryWang
janryWang

docs(react): fix the typo on ISchemaFieldProps

Before submitting a pull request, please make sure the following is done...

  • Ensure the pull request title and commit message follow the Commit Specific in English.
  • Fork the repo and create your branch from master or formily_next.
  • If you've added code that should be tested, add tests!
  • If you've changed APIs, update the documentation.
  • Ensure the test suite passes (npm test).
  • Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.

Please do not delete the above content


What have you changed?

started
started time in 2 hours ago
Activity icon
issue

codecov[bot] issue comment alibaba/formily

codecov[bot]
codecov[bot]

docs(react): fix the typo on ISchemaFieldProps

Before submitting a pull request, please make sure the following is done...

  • Ensure the pull request title and commit message follow the Commit Specific in English.
  • Fork the repo and create your branch from master or formily_next.
  • If you've added code that should be tested, add tests!
  • If you've changed APIs, update the documentation.
  • Ensure the test suite passes (npm test).
  • Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.

Please do not delete the above content


What have you changed?

codecov[bot]
codecov[bot]

Codecov Report

Merging #2528 (367b089) into formily_next (432f620) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##           formily_next    #2528   +/-   ##
=============================================
  Coverage         95.65%   95.65%           
=============================================
  Files               141      141           
  Lines              6313     6313           
  Branches           1719     1719           
=============================================
  Hits               6039     6039           
  Misses              243      243           
  Partials             31       31           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 432f620...367b089. Read the comment docs.

Activity icon
fork

jingrui2017 forked alibaba/Sentinel

⚡ A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
jingrui2017 Apache License 2.0 Updated
fork time in 2 hours ago
Activity icon
issue

Z8264 issue comment alibaba/formily

Z8264
Z8264

[Bug Report] Space 组件布局 align 属性不起作用

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  • 使用 @formily/next 的 space 组件布局

  • 设置如下属性:

    direction: "vertical"

    align: "start"

  • align: "start" 不起作用,实际效果为 center

What is expected?

align: "start",实际效果与配置一致

What is actually happening?

align: "start" 配置不起作用

Package

@formily/[email protected] @formily/[email protected]

Z8264
Z8264

@janryWang 这个是按照 https://fusion.formilyjs.org/zh-CN/components/space 示例写的,align默认应该是start,但是vertical 情况下是 center,能告诉下解决方案吗?

started
started time in 2 hours ago
started
started time in 2 hours ago
started
started time in 2 hours ago
started
started time in 2 hours ago
Activity icon
issue

CLAassistant issue comment alibaba/formily

CLAassistant
CLAassistant

docs(react): fix the typo on ISchemaFieldProps

Before submitting a pull request, please make sure the following is done...

  • Ensure the pull request title and commit message follow the Commit Specific in English.
  • Fork the repo and create your branch from master or formily_next.
  • If you've added code that should be tested, add tests!
  • If you've changed APIs, update the documentation.
  • Ensure the test suite passes (npm test).
  • Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.

Please do not delete the above content


What have you changed?

CLAassistant
CLAassistant

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

pull request

B2D1 pull request alibaba/formily

B2D1
B2D1

docs(react): fix the typo on ISchemaFieldProps

Before submitting a pull request, please make sure the following is done...

  • Ensure the pull request title and commit message follow the Commit Specific in English.
  • Fork the repo and create your branch from master or formily_next.
  • If you've added code that should be tested, add tests!
  • If you've changed APIs, update the documentation.
  • Ensure the test suite passes (npm test).
  • Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.

Please do not delete the above content


What have you changed?

started
started time in 3 hours ago
Activity icon
fork

B2D1 forked alibaba/formily

⚡ Alibaba Group Unified Form Solution -- Support React/ReactNative/Vue2/Vue3
B2D1 MIT License Updated
fork time in 3 hours ago
started
started time in 3 hours ago
started
started time in 3 hours ago
Activity icon
issue

Ying-Kang issue alibaba/MNN

Ying-Kang
Ying-Kang

ONNX模型转MNN模型后在ios端推理结果错误

平台(如果交叉编译请再附上交叉编译目标平台):

  • linux

Github版本:

  • master
  • 71cd04e91c9281412ff8f7c2b29cd9019195131e

编译方式:

  • linux编译,没有报错

编译日志:

  • linux编译,没有报错

详细描述

转换并验证成功的onnx模型转换为mnn模型之后

与编译出来的推理库一起放到ios端应用里推理

得不到正确结果

模型是做图像分割的,节点输出的各个维度都对,但是模型得到的结果和onnx输出的结果对不上,尝试过检查:

  • onnx模型的分割结果没有问题,可视化达到预期

  • mnn转换过程没有报错,参考官方文档使用fastTestOnnx.py,TEST_SUCCESS,输出结果如下 转换成功的截图 image 验证通过截图 image

  • ios侧与团队小伙伴检查过输出和输入维度,均是mnn内部自动获取,仅有的地方已经check,ios的简单调用代码如下:

//
//  DuFootMeasureModel.m
//  DuMNNDemo
//
//  Created by admin on 11/24/21.
//

#import <opencv2/opencv.hpp>
#import "DuFootMeasureModel.h"
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <MNN/HalideRuntime.h>
#import <MNN/MNNDefine.h>
#import <MNN/ErrorCode.hpp>
#import <MNN/ImageProcess.hpp>
#import <MNN/Interpreter.hpp>
#import <MNN/Tensor.hpp>
#import "UIImage+Utility.h"
#import "UIImage+Resize.h"

@interface DuFootMeasureModel ()
{
    std::shared_ptr<MNN::Interpreter>net_;
    MNN::Session *session_;
}

@property (nonatomic, strong) NSArray *outputKeys;
@property (nonatomic, strong) UIImage *resultImage ;
@end

@implementation DuFootMeasureModel

/// 创建model
-(instancetype)initWithModelPath:(NSString *)modelPath {
    self = [super init];
    if (self) {
        if (![[NSFileManager defaultManager] fileExistsAtPath:modelPath]) {
            NSLog(@"---- model 文件不存在!!");
            return nil;
        }
        self.outputKeys = @[@"BG", @"A1", @"A2", @"A3", @"A4", @"B1", @"B2", @"C1", @"C2", @"D1", @"D2", @"E1", @"E2", @"E3", @"E4", @"F1", @"F2", @"G1", @"G2", @"H1", @"H2", @"J1", @"J2", @"J3", @"J4", @"K1", @"K2", @"P", @"O", @"I", @"Z", @"N", @"0", @"foot"];
        [self loadSessionWithModelPath:modelPath];
    }
    return self;
}

/// 创建模型和session
- (void)loadSessionWithModelPath:(NSString *)modelPath {
    net_ = std::shared_ptr<MNN::Interpreter>(MNN::Interpreter::createFromFile(modelPath.UTF8String));
    
    //  2、创建 session
    MNN::ScheduleConfig config;
    config.type = MNN_FORWARD_METAL;//  GPU
    config.backupType = MNN_FORWARD_CPU;// GPU跑不起来就用CPU
    config.numThread = 4;

    MNN::BackendConfig backendConfig;
    backendConfig.memory = MNN::BackendConfig::Memory_High;  // 内存
    backendConfig.power = MNN::BackendConfig::Power_High;  // 功耗
    backendConfig.precision = MNN::BackendConfig::PrecisionMode::Precision_High;  // 精度
    config.backendConfig = &backendConfig;
    
    session_ = net_->createSession(config);
}

/// 跑图片
- (NSDictionary *)inferImageWithPath:(NSString *)imagePath {
    if (![[NSFileManager defaultManager] fileExistsAtPath:imagePath]) {
        NSLog(@"ERROR:image 不存在:%@", imagePath);
        return nil;
    }
    UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
    if (!image) {
        NSLog(@"ERROR:文件不是图片! %@", imagePath);
        return nil;
    }
    
    //  resize image
    MNN::Tensor *inputTensor = net_->getSessionInput(session_, nullptr);
    auto dims = inputTensor->shape();
    MNN::Tensor::DimensionType dimsType = inputTensor->getDimensionType();
//    NSLog(@"--- dims type: %d", dimsType); // 1: CAFFE
    int width = 0, height = 0;
    switch (dimsType) {
        case MNN::Tensor::DimensionType::TENSORFLOW:{
            height = dims[1];
            width = dims[2];
        }
            break;
        case MNN::Tensor::DimensionType::CAFFE:{
            height = dims[2];
            width = dims[3];
        }
            break;
        default:{
            height = dims[2];
            width = dims[3];
        }
            break;
    }
//    NSLog(@"--- width: %d, height: %d", width, height); // 512, 512
    if (width != image.size.width || height != image.size.height) {
        image = [image resizeWithSize:CGSizeMake(width, height)];
    }
    //  获取输入 data
    unsigned char *rgba = (unsigned char *)calloc(width * height * 4, sizeof(unsigned char));
    {
        CGColorSpaceRef colorSpace = CGImageGetColorSpace(image.CGImage);
        CGContextRef contextRef = CGBitmapContextCreate(rgba,
                                                        width,
                                                        height,
                                                        8,
                                                        width * 4,
                                                        colorSpace,
                                                        kCGImageAlphaNoneSkipLast | kCGBitmapByteOrderDefault);
        
        CGContextDrawImage(contextRef, CGRectMake(0, 0, width, height), image.CGImage);
        CGContextRelease(contextRef);
    }
    const float means[3]   = {103.94f, 116.78f, 123.68f};
    const float normals[3] = {0.017f, 0.017f, 0.017f};
    auto pretreat = std::shared_ptr<MNN::CV::ImageProcess>( MNN::CV::ImageProcess::create(MNN::CV::RGBA, MNN::CV::RGB, means, 3, normals, 3));
    
//    MNN::CV::Matrix matrix;
//    matrix.postScale((width - 1) / 223.0, (height - 1) / 223.0);
//    pretreat->setMatrix(matrix);
//    inputTensor->print();
    pretreat->convert(rgba, width, height, 0, inputTensor);
    
    free(rgba);
    
    CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
    //  output
    MNN::Tensor *output = net_->getSessionOutput(session_, nullptr);
    MNN::Tensor outCache(output);
    
    MNN::Tensor inputCache(inputTensor);
    inputTensor->copyToHostTensor(&inputCache);
    
    //  run
    inputTensor->copyFromHostTensor(&inputCache);
    net_->runSession(session_);
    output->copyToHostTensor(&outCache);
    
    NSLog(@"--- 推理耗时: %f", (CFAbsoluteTimeGetCurrent() - start) * 1000.0);
    
    int *outputData = (int *)outCache.buffer().host;
    int outWidth = outCache.width();
    int outHeight = outCache.height();
    
    //  debug code
    int *tmpData = new int[outWidth * outHeight];
    for (int i = 0; i < width * height; i ++) {
//        NSLog(@"---%d", outputData[i]);
        tmpData[i] = outputData[i] == 0 ? 0 : 255;
    }
    UIImage *retImage = utility::UIImageWithDataRGBA(tmpData, outWidth, outHeight);
    self.resultImage = retImage;
    
    free(tmpData);
    
    
    return [self calculateCenterPointWithData:outputData width:outWidth height:outHeight];
}

   
}


/// 获取结果图片
- (UIImage *)getResultImage {
    return self.resultImage;
}

@end

上面的代码是截取的调用部分,debug的注释日志也在

模型在onnx环境下输入是rgb的图像,shape是(1, 3, 512, 512), ,类型是uint8 输出是(512, 512)的图像,类型也是uint8, 拜托帮忙看看 onnx和mnn的输出精度差距很大, 多了很多假阳性的分割, 不能投入到生产中使用 且目前无法定位到问题,提供我的模型在这里 model.mnn.zip 希望能帮忙解决落地的最后一个环节,感激

started
started time in 3 hours ago
Activity icon
issue

Z8264 issue comment alibaba/formily

Z8264
Z8264

[Bug Report] Space 组件布局 align 属性不起作用

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  • 使用 @formily/next 的 space 组件布局

  • 设置如下属性:

    direction: "vertical"

    align: "start"

  • align: "start" 不起作用,实际效果为 center

What is expected?

align: "start",实际效果与配置一致

What is actually happening?

align: "start" 配置不起作用

Package

@formily/[email protected] @formily/[email protected]

Z8264
Z8264

@janryWang 这个是Fusion next 不是antd ,能告诉我哪里错了吗?感谢

Activity icon
fork

licunzhi forked alibaba/COLA

⚡ 🥤 COLA: Clean Object-oriented & Layered Architecture
licunzhi GNU Lesser General Public License v2.1 Updated
fork time in 3 hours ago
started
started time in 3 hours ago