Code Monkey home page Code Monkey logo

identification-nn's Introduction

API description

1.エンドポイント


class Request(BaseModel):
    similarity : float
    date_difference : float

https://fast-api-production.up.railway.app/path/

  • similarity : コサイン類似度・float

  • date_difference : 日付のズレをmsにしたもの

@app.post("/predict/", response_model=Response)
async def demo_get_path_id(req_body: Request):
    try:
        ch_sec = req_body.date_id / 1000 / 1000
        date_std = (ch_sec - mean)/std
        new_data = np.array([[req_body.cos_id, date_std]])
        if ch_sec >= 400:
            return Response(data=[0, 1])
        else:
            return Response(data=[model.predict(new_data)[0],model.predict(new_data)[1]])

    except Exception as e:
        return Response(data=[-1, 1], error=str(e))

2.戻り値

class Response(BaseModel):
    data: [float, float]
    error: Optional[str] = None

{"res":[rate_true,rate_false]}

  • rate_true : その人の落とし物である確率
  • rate_false : その人の落とし物でない確率

FastAPI Example

This example starts up a FastAPI server.

Deploy on Railway

✨ Features

  • FastAPI
  • Python 3

💁‍♀️ How to use

  • Deploy using the button 👆
  • Clone locally and install packages with Pip using pip install -r requirements.txt or Poetry using poetry install
  • Connect to your project using railway link
  • Run locally using uvicorn main:app --reload

📝 Notes

  • To learn about how to use FastAPI with most of its features, you can visit the FastAPI Documentation.
  • FastAPI provides automatic documentation to call and test your API directly from the browser. You can access it at /docs with Swagger or at /redoc with Redoc.

identification-nn's People

Contributors

ituki0426 avatar deviouslab avatar jakecooper avatar milo123459 avatar erwinkn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.