Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@cornerstonejs/ai
Advanced tools
This package provides AI interfaces for use with Cornerstone in client-side applications. It is designed to support the use of ONNX models, ensuring a clean separation between server-side AI processing and client-specific functionalities tied to Cornerstone.
To see the package in action with the Segment Anything Model, use the following command:
yarn run example segmentAnythingClientSide
This will load the SAM model in the browser and allow you to perform segmentation tasks on images.
The package does not include model binaries due to their size and to give users the flexibility to use their own models. You can download pre-trained model binaries from the following links:
Base model (vit_b) - 178 MB compressed
Large model (vit_l) - 1.16 GB compressed
Huge model (vit_h) - 2.38 GB compressed
For the examples we are using the model url and fetch it from the web. If you see in example code we have:
const models = {
sam_b: [
{
name: 'sam-b-encoder',
url: 'https://huggingface.co/schmuell/sam-b-fp16/resolve/main/sam_vit_b_01ec64.encoder-fp16.onnx',
size: 180,
key: 'encoder',
},
{
name: 'sam-b-decoder',
url: 'https://huggingface.co/schmuell/sam-b-fp16/resolve/main/sam_vit_b_01ec64.decoder.onnx',
size: 17,
key: 'decoder',
},
],
};
const ai = new ONNXSegmentationController({
listeners: [mlLogger],
models,
modelName: 'sam_b',
});
which gives the url to the model files.
You can download the model files and use them offline by moving them to the public folder.
In Webpack you can add the model files to the public folder like this
new CopyPlugin({
patterns: [
{
from:
'../../../externals/sam_l',
to: '${destPath.replace(/\\/g, '/')}/sam_l',
},
{
from:
'../../../externals/sam_h',
to: '${destPath.replace(/\\/g, '/')}/sam_h',
},
],
}),
, other build systems might have a different way to do this.
FAQs
AI and ML Interfaces for Cornerstone3D
The npm package @cornerstonejs/ai receives a total of 0 weekly downloads. As such, @cornerstonejs/ai popularity was classified as not popular.
We found that @cornerstonejs/ai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.