Coder Social home page Coder Social logo

Comments (8)

daisymind avatar daisymind commented on July 22, 2024 1

Hi, sgebr01.

I am using the original model 'isnet-general-use.pth' converted to a CoreML model '.mlmodel'.

You can get the CoreML model converted by jphon-rocky and the conversion script at the following URL.
Find IS-Net (= DIS) on the page.
https://github.com/john-rocky/CoreML-Models

And more, for your reference..., the mlmodel is 8bit quantized in the iphone app for compactness.

# Quantization sample code :Python with Apple coremltools
import coremltools as ct
from coremltools.models.neural_network import quantization_utils

# load full precision model = 32bit
model = ct.models.MLModel('ISNet_general_use.mlmodel')

# in case of 8bit quantization
quantized_model = quantization_utils.quantize_weights(model, 8)
quantized_model.save('quantized08_ISNet_general_use.mlmodel')

see https://developer.apple.com/documentation/coreml/model_customization/reducing_the_size_of_your_core_ml_app
and https://coremltools.readme.io/docs/quantization

from dis.

daisymind avatar daisymind commented on July 22, 2024 1

Hi roimulia2.
You can get the one from here.
https://drive.google.com/file/d/1-8FIZGVIXOHrAd8VljkwF0Sv8lIkBpdR/view?usp=sharing

Appendix:
Simply on Google Colab, mlmodel can be converted to 8bits-quantize file with below .ipynb code.

from google.colab import drive
drive.mount('/content/drive')

!pip install coremltools
basePath = '/content/drive/MyDrive/CoreML'   # This line, edit for your work Path

import coremltools as ct
from coremltools.models.neural_network import quantization_utils

# load full precision model = 32bit
model = ct.models.MLModel(basePath+'/ISNet_general_use.mlmodel') # orign mlmodel file name

# Quantize  8bits
nbits = 8
quantized_model = quantization_utils.quantize_weights(model, nbits)
quantized_model.save(basePath+'/quantized08_ISNet_general_use.mlmodel') # save to quantized file name
print('...Finished: quantized 8bit')

from dis.

xuebinqin avatar xuebinqin commented on July 22, 2024

from dis.

daisymind avatar daisymind commented on July 22, 2024

Thanks for the reply.
I know that the dataset has a big impact, however, I was wondering because this IS-Net general use model works so well without human or animal data. As you say, maybe there is a network made that can detect some central object.

I look forward to your future research, and the V2 dataset.

Best Regards,

from dis.

sgebr01 avatar sgebr01 commented on July 22, 2024

@daisymind Did you make this an API, or implement a CoreML Model?

from dis.

sgebr01 avatar sgebr01 commented on July 22, 2024

Great thank you, I appreciate it.

from dis.

roimulia2 avatar roimulia2 commented on July 22, 2024

Hey @daisymind! Thank you for the info :) Any chance you can send the quantatized MLModel here? I'm having an issue setup the environment on my mac

from dis.

roimulia2 avatar roimulia2 commented on July 22, 2024

Perfect, thank you so much :)

from dis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.