File size: 496 Bytes
8f260ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from typing import Any, Dict, List
from fastsam import FastSAM, FastSAMPrompt
import numpy as np
from configs.config import DEVICE, FAST_SAM_CONF, FAST_SAM_IMGSZ, FAST_SAM_IOU, FAST_SAM_RETINA_MASKS

def preprocess(points_data: List[Dict]) -> Any:
    
    input_points = []
    input_labels = []
    
    for point in points_data:
        input_points.append([int(point['x_']), int(point['y_'])])
        input_labels.append(int(point['flag_']))
    
    return input_points, input_labels