A computer-implemented method for determining body postures and activities, the method comprising: calibrating a device collecting sensor data such that axes of the device match axes of a body, wherein the sensor data comprises one or more acceleration signals obtained in any one or more of X axis, Y axis and Z axis; detecting a body transition of a body based on calibrated sensor data by computing a transition signal, and if the transition signal exceeds a transition threshold, classifying the body transition of the body, wherein classifying the body transition comprises: finding extrema and extrema timings in Y and Z acceleration signals, wherein Y acceleration signals corresponds to acceleration in head-to-toe axis of the body and Z acceleration signals corresponds to acceleration in a front-to-back axis of the body, calculating features as functions of signal area estimations surrounding detected extrema in Y and Z acceleration signals, comparing extrema to a predetermined threshold to reject artifacts, identifying the transition as unknown activity in case of features identified as potential artifacts, and classifying the transition as any of stand-to-sit, sit-to-stand, or bending over, based on distances calculated using classification model weights; determining if there is activity of the body based on the obtained sensor data; if there is activity, classifying the activity; and if there is no activity, classifying a rest position of the body, wherein the rest position of the body is classified based on the obtained sensor data and the detected body transition. calibrating a device collecting sensor data such that axes of the device match axes of a body, wherein the sensor data comprises one or more acceleration signals obtained in any one or more of X axis, Y axis and Z axis; detecting a body transition of a body based on calibrated sensor data by computing a transition signal, and if the transition signal exceeds a transition threshold, classifying the body transition of the body, wherein classifying the body transition comprises: finding extrema and extrema timings in Y and Z acceleration signals, wherein Y acceleration signals corresponds to acceleration in head-to-toe axis of the body and Z acceleration signals corresponds to acceleration in a front-to-back axis of the body, calculating features as functions of signal area estimations surrounding detected extrema in Y and Z acceleration signals, comparing extrema to a predetermined threshold to reject artifacts, identifying the transition as unknown activity in case of features identified finding extrema and extrema timings in Y and Z acceleration signals, wherein Y acceleration signals corresponds to acceleration in head-to-toe axis of the body and Z acceleration signals corresponds to acceleration in a front-to-back axis of the body, calculating features as functions of signal area estimations surrounding detected extrema in Y and Z acceleration signals, comparing extrema to a predetermined threshold to reject artifacts, identifying the transition as unknown activity in case of features identified as potential artifacts, and classifying the transition as any of stand-to-sit, sit-to-stand, or bending over, based on distances calculated using classification model weights; determining if there is activity of the body based on the obtained sensor data; if there is activity, classifying the activity; and if there is no activity, classifying a rest position of the body, wherein the rest position of the body is classified based on the obtained sensor data and the detected body transition. <EOS>