TasslehofBurfoot's picture
Initial commit: Stroke detection web app
02e7228
raw
history blame contribute delete
392 Bytes
import axios from 'axios';
import type { PredictionResponse } from '../types';
const api = axios.create({
baseURL: '/api',
});
export async function predictImage(file: File): Promise<PredictionResponse> {
const formData = new FormData();
formData.append('file', file);
const { data } = await api.post<PredictionResponse>('/predict', formData);
return data;
}
export default api;