Comments (2)
Hi @Mediumcore ,
This would require distilling a new model, for this you may be able to follow these steps.
Disclaimer: I haven't tested these, so let me know if you run into issues.
Step 1 - Register a new model
Register a new model, and ensure that it outputs features of shape 256x64x64 for your desired input resolution. For example, for an input of size 512x512, your model must have an output stride of 8.
You can register the model similar to here:
You could try registering a new model with a different stride, and setting the student size to a lower resolution (ie: 512x512).
Step 2 - Train the distilled model
Next, you'll need to train the model on unlabeled images. Follow the training instructions in the README, but set the "student_size" parameter to the desired size (512).
nanosam/nanosam/tools/train.py
Line 33 in 6536336
Step 3 - Evaluate the distilled model
Follow the evaluation instructions in the README to compare the accuracy for small / medium / large objects.
As a note: It's worth noting that distillation only applies to the image encoder. It's worth benchmarking the mask decoder to see if this is worth it, as the image encoding speed is approaching the decoding speed and may no longer be a performance bottleneck.
Hope this helps. If we end up releasing a lower resolution model I will update this thread, but we have no current plans at the moment.
John
from nanosam.
Understood,thank you very much for reply
from nanosam.
Related Issues (20)
- Issue with building TensorRT engine for the mask decoder HOT 2
- definition of point label HOT 2
- question about mask dimension HOT 3
- Reimplemented nanosam in cpp HOT 1
- trtexec fails to build /mobile_sam_mask_decoder.onnx HOT 5
- Compiled against cuBLASLt 11.10.3.0 but running against cuBLASLt 11.5.1.0. help me please.. HOT 1
- Device memory is insufficient to use tactic for jetson NANO HOT 1
- how can I train a new student model rather than only resnet? HOT 2
- good work! HOT 2
- how can i get a segment mask
- Parameters tuning HOT 1
- Usage problem in PC : )
- Does it support multi-target real-time detection and segmentation? HOT 1
- Can you provide the torch model of ResNet18? HOT 2
- How can I write a generator based on this foundation HOT 1
- trtexec Failed for mobile_sam_mask_decoder.onnx HOT 4
- RuntimeError: Numpy is not available HOT 2
- void
- tensorrt c++ And mask decoder can be fp16 without too big error? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nanosam.