今年來AI的發(fā)展非常迅速,在工業(yè)、醫(yī)療等等行業(yè)逐漸出現(xiàn)相應(yīng)的解決方案,AI也逐漸成為各行業(yè)基礎(chǔ)設(shè)施建設(shè)重要的一環(huán),未來發(fā)展的大趨勢(shì),不過這也需要一個(gè)漫長(zhǎng)的過程,需要很多技術(shù)型人才加入其中,除了工業(yè)設(shè)施的基礎(chǔ)建設(shè),在娛樂方向也有很多有趣的能力,不如圖片/視頻換背景、人像(圖片/視頻)動(dòng)漫化、圖片內(nèi)容擦除等等。
今天我們來嘗試操作一下使用圖片內(nèi)容擦除模型來實(shí)現(xiàn)相應(yīng)的功能,首先來看看擦除模型:
1、advimman/lamaGitHub - advimman/lama: ?? LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022
?2、fenglinglwb/MAT
GitHub - fenglinglwb/MAT: MAT: Mask-Aware Transformer for Large Hole Image Inpainting
3、?Picsart-AI-Research/MI-GA
GitHub - Picsart-AI-Research/MI-GAN: [ICCV 2023] MI-GAN: A Simple Baseline for Image Inpainting on Mobile Devices
還有很多,詳情見MI-GAN: A Simple Baseline for Image Inpainting on Mobile Devices – IOPaint?
擦除模型基于圖片物體興趣區(qū)域(Rect)分割的mask結(jié)果,結(jié)合原圖實(shí)現(xiàn)圖片多余內(nèi)容的擦除。?
其實(shí)在Opencv里也有圖片修復(fù)功能(inpaint),簡(jiǎn)單的圖片修復(fù)、多余內(nèi)容擦除還是可以實(shí)現(xiàn)的,比如圖片/視頻擦除水印、一些小的劃痕等等,但是對(duì)于大范圍的內(nèi)容擦除就無能為力了,雖然可以擦除效果還是太差,有很多像素異常內(nèi)容。
物體分割模型也有很多:?
1、facebookresearch/segment-anything
GitHub - facebookresearch/segment-anything: The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
?2、ChaoningZhang/MobileSAM
GitHub - ChaoningZhang/MobileSAM: This is the official code for MobileSAM project that makes SAM lightweight for mobile applications and beyond!
3、?SysCV/sam-hq
GitHub - SysCV/sam-hq: Segment Anything in High Quality [NeurIPS 2023]
4、?chongzhou96/EdgeSAM
GitHub - chongzhou96/EdgeSAM: Official PyTorch implementation of "EdgeSAM: Prompt-In-the-Loop Distillation for On-Device Deployment of SAM"
SEG-CPP是對(duì)于以上物體分割模型的C++實(shí)現(xiàn),也對(duì)其進(jìn)行模型onnx的轉(zhuǎn)化,里面也實(shí)現(xiàn)了對(duì)相關(guān)模型的量化處理,是模型大小減小了數(shù)倍,為物體分割模型在移動(dòng)設(shè)備上使用奠下基礎(chǔ)。文章來源:http://www.zghlxwxcb.cn/news/detail-849842.html
要實(shí)現(xiàn)物體分割模型和物體擦除模型在Android上使用,我們需要文章來源地址http://www.zghlxwxcb.cn/news/detail-849842.html
到了這里,關(guān)于Android+OnnxRuntime+Opencv+Onnx模型操作圖片擦除多余內(nèi)容的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!