diff with rotation function
"for parameters, img in create_pipeline_dataset(4).take(1): \n",
" print(determine_rotation_diff(parameters, parameters))\n",
" print(determine_rotation_diff(parameters, adjust_rotation(parameters, 1)))\n",
- " print(determine_rotation_diff(parameters, adjust_rotation(parameters, 89)))\n",
+ " print(determine_rotation_diff(parameters, adjust_rotation(parameters, 90)))\n",
" print(determine_rotation_diff(parameters, adjust_rotation(parameters, 180)))\n",
" print(determine_rotation_diff(parameters, adjust_rotation(parameters, 181)))\n",
" print(determine_rotation_diff(parameters, adjust_rotation(parameters, 179)))"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def determine_diff_with_rotation(predicted_parameters, ground_truth_parameters):\n",
+ " diff = tf.concat([\n",
+ " predicted_parameters[:, 0:4] - ground_truth_parameters[:, 0:4],\n",
+ " determine_rotation_diff(predicted_parameters, ground_truth_parameters)[:, None] / 180,\n",
+ " predicted_parameters[:, 5::] - ground_truth_parameters[:, 5::],\n",
+ " ], axis=-1)\n",
+ " \n",
+ " return diff\n",
+ "\n",
+ "\n",
+ "for parameters, img in create_pipeline_dataset(4).take(1):\n",
+ " print(determine_diff_with_rotation(parameters, parameters + 1))\n",
+ " print(determine_diff_with_rotation(parameters, adjust_rotation(parameters, 1)))\n",
+ " print(determine_diff_with_rotation(parameters, adjust_rotation(parameters, 90)))\n",
+ " print(determine_diff_with_rotation(parameters, adjust_rotation(parameters, 180)))\n",
+ " print(determine_diff_with_rotation(parameters, adjust_rotation(parameters, 181)))\n",
+ " print(determine_diff_with_rotation(parameters, adjust_rotation(parameters, 179)))"
+ ]
+ },
{
"cell_type": "code",
"execution_count": null,
