MCPcopy Create free account
hub / github.com/CSAILVision/gandissect / generateFeaturesLocal

Method generateFeaturesLocal

client_dist/ganclient.js:310–344  ·  view source on GitHub ↗
(project, ids, layers, masks, ablations = [])

Source from the content-addressed store, hash-verified

308 });
309 }
310 generateFeaturesLocal(project, ids, layers, masks, ablations = []) {
311 /*
312 project = feat_req['project']
313 ids = feat_req['ids']
314 masks = feat_req.get('masks', None)
315 layers = feat_req.get('layers', None)
316 ablations = feat_req.get('ablations', [])
317 */
318 // const ids = imasks.map(d => d.id);
319 // const masks = imasks.map(d => ({
320 // shape: [],
321 // bitbounds: [],
322 // bitstring: d.mask
323 // }));
324 masks.forEach(mask => {
325 if (mask.bitstring == null) {
326 const bb = mask.bitbounds;
327 const bits = (bb[2] - bb[0]) * (bb[3] - bb[1]);
328 mask.bitstring = '1'.repeat(bits);
329 }
330 });
331 return d3__WEBPACK_IMPORTED_MODULE_0__["json"](this.baseURL + '/api/features', {
332 method: "POST",
333 body: JSON.stringify({
334 ablations,
335 project,
336 ids,
337 masks,
338 layers
339 }),
340 headers: {
341 "Content-type": "application/json; charset=UTF-8"
342 }
343 });
344 }
345}
346
347

Callers 1

ganclient.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected