Oskar's SwingVision Data Model API
If you export the .xlsx file out of the SwingVision app on your phone, this trick allows you to analyze the data using a webpage. Now you can do some good graphs and take specific snippets from the video (still need to figure that out).

First you need to convert the .xlsx file into csv files you do it by running the python package, xlsx2csv, (need to install using pip) like so:
xlsx2csv -s 2 SwingVision-Ball_Machine_Practice-2023-02-12_at_22.46.02.xlsx shots_file.csv
Then you dump this script on a webserver that runs PHP, this php code converts the csv into a JSON type format and these functions are used to do the number crunching which is now easy enough to graph it up.

An example of this code is posted at: http://boxa.labbot3dsystems.com/tennisdata/data.org.php

If you like this show some love and use our referral code if you still haven't up for SwingVision:
https://swing.tennis/r/ee4778c442f60bcf>https://swing.tennis/r/ee4778c442f60bcf

https://swing.tennis/matches/sw2-Nwjhejk

Forehand

Speed (MPH)
Array ( [max] => 81.060181 [min] => 22.17911 )
Max speed data point
Array ( [Spin] => Topspin [Speed (MPH)] => 81.060181 [Point] => 3 [Game] => 0 [Set] => 0 [Stroke] => Forehand [Bounce Depth] => service_box [Bounce Zone] => deuce [Bounce Side] => near [Bounce (x)] => 3.049206 [Bounce (y)] => 5.717381 [Hit Depth] => out [Hit Zone] => deuce [Hit Side] => far [Hit (x)] => -0.317848 [Hit (y)] => 25.668915 [Hit (z)] => 1.295666 [Direction] => inside out [Result] => In [Favorited] => false [Start Time] => 22:52:34 [Video Time] => 392.190002 )

Hit (x)
Array ( [max] => 4.617431 [min] => -5.690667 )

Hit (y)
Array ( [max] => 25.670935 [min] => -2.931655 )

Hit (z)
Array ( [max] => 2.173507 [min] => -0.018242 )

Bounce (x)
Array ( [max] => 4.60292 [min] => -5.059446 )

Bounce (y)
Array ( [max] => 25.975733 [min] => 0.540634 )

Shot direction
Array ( [nodirection] => 2 [downtheline] => 76 [crosscourt] => 41 [0] => Array ( [down the T] => 0 ) [1] => Array ( [out wide] => 0 ) [2] => Array ( [inside out] => 20 ) )

Result
Array ( [in] => 125 [out] => 17 [net] => 10 )

Spin
Array ( [top] => 59 [back] => 18 [flat] => 75 )

Bounce Depth
Array ( [out] => 9 [Service box] => 58 [No mans land] => 85 )
Hit Depth
Array ( [out] => 88 [Service box] => 5 [No mans land] => 59 )

Bounce Zone
Array ( [deuce] => 65 [deuce_out] => 0 [deuce_alley] => 4 [0] => Array ( [ad] => 77 [ad_out] => 0 [ad_alley] => 6 ) )
Hit Zone
Array ( [deuce] => 34 [deuce_out] => 0 [deuce_alley] => 0 [0] => Array ( [ad] => 70 [ad_out] => 3 [ad_alley] => 45 ) )

Bounce Side
Array ( [near] => 19 [far] => 133 )
Hit Side
Array ( [near] => 143 [far] => 9 )



Backhand

Speed (MPH)
Array ( [max] => 79.758636 [min] => 21.870155 )
Max speed data point
Array ( [Spin] => Topspin [Speed (MPH)] => 79.758636 [Point] => 2 [Game] => 0 [Set] => 0 [Stroke] => Backhand [Bounce Depth] => no_mans_land [Bounce Zone] => deuce [Bounce Side] => near [Bounce (x)] => 3.64028 [Bounce (y)] => 2.750042 [Hit Depth] => no_mans_land [Hit Zone] => deuce [Hit Side] => far [Hit (x)] => -0.475156 [Hit (y)] => 21.718019 [Hit (z)] => 3.241124 [Direction] => cross court [Result] => In [Favorited] => false [Start Time] => 22:52:06 [Video Time] => 364.390015 )

Hit (x)
Array ( [max] => 4.990055 [min] => -4.474311 )

Hit (y)
Array ( [max] => 25.363659 [min] => -2.650403 )

Hit (z)
Array ( [max] => 3.241124 [min] => 0.206607 )

Bounce (x)
Array ( [max] => 5.424457 [min] => -4.996016 )

Bounce (y)
Array ( [max] => 25.694525 [min] => 1.168921 )

Shot direction
Array ( [nodirection] => 0 [downtheline] => 59 [crosscourt] => 31 [0] => Array ( [down the T] => 0 ) [1] => Array ( [out wide] => 0 ) [2] => Array ( [inside out] => 8 ) )

Result
Array ( [in] => 82 [out] => 8 [net] => 15 )

Spin
Array ( [top] => 47 [back] => 22 [flat] => 36 )

Bounce Depth
Array ( [out] => 5 [Service box] => 41 [No mans land] => 59 )
Hit Depth
Array ( [out] => 43 [Service box] => 6 [No mans land] => 56 )

Bounce Zone
Array ( [deuce] => 50 [deuce_out] => 0 [deuce_alley] => 2 [0] => Array ( [ad] => 51 [ad_out] => 0 [ad_alley] => 2 ) )
Hit Zone
Array ( [deuce] => 67 [deuce_out] => 0 [deuce_alley] => 23 [0] => Array ( [ad] => 14 [ad_out] => 0 [ad_alley] => 1 ) )

Bounce Side
Array ( [near] => 19 [far] => 86 )
Hit Side
Array ( [near] => 101 [far] => 4 )



Serve

Speed (MPH)
Array ( [max] => 90.400688 [min] => 44.525764 )
Max speed data point
Array ( [Spin] => Kick [Speed (MPH)] => 90.400688 [Point] => 118 [Game] => 0 [Set] => 0 [Stroke] => Serve [Bounce Depth] => service_box [Bounce Zone] => deuce [Bounce Side] => far [Bounce (x)] => -1.47576 [Bounce (y)] => 17.166508 [Hit Depth] => out [Hit Zone] => deuce [Hit Side] => near [Hit (x)] => 0.59658 [Hit (y)] => -0.533556 [Hit (z)] => 2.642998 [Direction] => down the T [Result] => In [Favorited] => false [Start Time] => 23:48:38 [Video Time] => 3755.620117 )

Hit (x)
Array ( [max] => 1.418449 [min] => -1.849086 )

Hit (y)
Array ( [max] => 24.215153 [min] => -1.293129 )

Hit (z)
Array ( [max] => 2.754398 [min] => 2.09057 )

Bounce (x)
Array ( [max] => 4.349212 [min] => -4.764182 )

Bounce (y)
Array ( [max] => 20.767187 [min] => 6.264452 )

Shot direction
Array ( [nodirection] => 0 [downtheline] => 0 [crosscourt] => 0 [0] => Array ( [down the T] => 48 ) [1] => Array ( [out wide] => 36 ) [2] => Array ( [inside out] => 0 ) )

Result
Array ( [in] => 52 [out] => 21 [net] => 11 )

Spin
Array ( [top] => 0 [back] => 36 [flat] => 15 )

Bounce Depth
Array ( [out] => 0 [Service box] => 68 [No mans land] => 16 )
Hit Depth
Array ( [out] => 27 [Service box] => 5 [No mans land] => 52 )

Bounce Zone
Array ( [deuce] => 40 [deuce_out] => 0 [deuce_alley] => 2 [0] => Array ( [ad] => 39 [ad_out] => 0 [ad_alley] => 3 ) )
Hit Zone
Array ( [deuce] => 42 [deuce_out] => 0 [deuce_alley] => 0 [0] => Array ( [ad] => 42 [ad_out] => 0 [ad_alley] => 0 ) )

Bounce Side
Array ( [near] => 16 [far] => 68 )
Hit Side
Array ( [near] => 75 [far] => 9 )



FH Volley

Speed (MPH)
Array ( [max] => 22.516716 [min] => 19.918634 )
Max speed data point
Array ( [Spin] => Flat [Speed (MPH)] => 22.516716 [Point] => 59 [Game] => 0 [Set] => 0 [Stroke] => FH Volley [Bounce Depth] => out [Bounce Zone] => deuce [Bounce Side] => far [Bounce (x)] => -1.484846 [Bounce (y)] => 24.126013 [Hit Depth] => no_mans_land [Hit Zone] => ad [Hit Side] => near [Hit (x)] => -0.466779 [Hit (y)] => 2.28556 [Hit (z)] => 1.606125 [Direction] => down the line [Result] => Out [Favorited] => false [Start Time] => 23:25:26 [Video Time] => 2363.889893 )

Hit (x)
Array ( [max] => 1.728449 [min] => -3.262555 )

Hit (y)
Array ( [max] => 19.958273 [min] => 2.28556 )

Hit (z)
Array ( [max] => 2.121326 [min] => 1.606125 )

Bounce (x)
Array ( [max] => -0.151936 [min] => -1.868935 )

Bounce (y)
Array ( [max] => 24.126013 [min] => 4.634364 )

Shot direction
Array ( [nodirection] => 0 [downtheline] => 1 [crosscourt] => 2 [0] => Array ( [down the T] => 0 ) [1] => Array ( [out wide] => 0 ) [2] => Array ( [inside out] => 0 ) )

Result
Array ( [in] => 1 [out] => 1 [net] => 1 )

Spin
Array ( [top] => 0 [back] => 0 [flat] => 3 )

Bounce Depth
Array ( [out] => 1 [Service box] => 1 [No mans land] => 1 )
Hit Depth
Array ( [out] => 0 [Service box] => 1 [No mans land] => 2 )

Bounce Zone
Array ( [deuce] => 1 [deuce_out] => 0 [deuce_alley] => 0 [0] => Array ( [ad] => 2 [ad_out] => 0 [ad_alley] => 0 ) )
Hit Zone
Array ( [deuce] => 0 [deuce_out] => 0 [deuce_alley] => 0 [0] => Array ( [ad] => 3 [ad_out] => 0 [ad_alley] => 0 ) )

Bounce Side
Array ( [near] => 2 [far] => 1 )
Hit Side
Array ( [near] => 2 [far] => 1 )



BH Volley

Speed (MPH)
Array ( [max] => 21.03163 [min] => 21.03163 )
Max speed data point
Array ( [Spin] => Flat [Speed (MPH)] => 21.03163 [Point] => 21 [Game] => 0 [Set] => 0 [Stroke] => BH Volley [Bounce Depth] => service_box [Bounce Zone] => deuce [Bounce Side] => near [Bounce (x)] => 0.715593 [Bounce (y)] => 11.613436 [Hit Depth] => service_box [Hit Zone] => deuce [Hit Side] => near [Hit (x)] => 2.526815 [Hit (y)] => 9.486144 [Hit (z)] => 2.386438 [Direction] => cross court [Result] => Net [Favorited] => false [Start Time] => 23:07:00 [Video Time] => 1258.030029 )

Hit (x)
Array ( [max] => 2.526815 [min] => 2.526815 )

Hit (y)
Array ( [max] => 9.486144 [min] => 9.486144 )

Hit (z)
Array ( [max] => 2.386438 [min] => 2.386438 )

Bounce (x)
Array ( [max] => 0.715593 [min] => 0.715593 )

Bounce (y)
Array ( [max] => 11.613436 [min] => 11.613436 )

Shot direction
Array ( [nodirection] => 0 [downtheline] => 0 [crosscourt] => 1 [0] => Array ( [down the T] => 0 ) [1] => Array ( [out wide] => 0 ) [2] => Array ( [inside out] => 0 ) )

Result
Array ( [in] => 0 [out] => 0 [net] => 1 )

Spin
Array ( [top] => 0 [back] => 0 [flat] => 1 )

Bounce Depth
Array ( [out] => 0 [Service box] => 1 [No mans land] => 0 )
Hit Depth
Array ( [out] => 0 [Service box] => 1 [No mans land] => 0 )

Bounce Zone
Array ( [deuce] => 1 [deuce_out] => 0 [deuce_alley] => 0 [0] => Array ( [ad] => 0 [ad_out] => 0 [ad_alley] => 0 ) )
Hit Zone
Array ( [deuce] => 1 [deuce_out] => 0 [deuce_alley] => 0 [0] => Array ( [ad] => 0 [ad_out] => 0 [ad_alley] => 0 ) )

Bounce Side
Array ( [near] => 1 [far] => 0 )
Hit Side
Array ( [near] => 1 [far] => 0 )