Skip to content

Commit

Permalink
optimized for bette table construction
Browse files Browse the repository at this point in the history
optimized imperceptibility data table for better readability and use
  • Loading branch information
ankanghosh101 committed May 30, 2024
1 parent a122cfa commit 5930e3c
Show file tree
Hide file tree
Showing 5 changed files with 2,095 additions and 604 deletions.
76 changes: 76 additions & 0 deletions .ipynb_checkpoints/watermarkdata-checkpoint.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Metric,PSNR,SSIM,CC,ATTACK
Max,41.02752504604772,0.9871698859122401,0.999813046615389,NOattack
Min,25.068264095554582,0.9779327582687767,0.9918958141972279,NOattack
Mean,39.060177850466516,0.9841190647394524,0.9992461165364881,NOattack
Max,10.823668846355783,0.7581118481568282,0.8461113797783216,rotation
Min,9.104524816426597,0.608897373960455,0.6124538179126104,rotation
Mean,10.037417097332415,0.6893241826931825,0.7389983969329736,rotation
Max,11.286221042519086,0.6710105143979807,0.9821072333068183,downscale
Min,10.9919478509117,0.6234457931561675,0.9337714399941289,downscale
Mean,11.180626463937333,0.6507581300421181,0.9671584363246661,downscale
Max,15.872153720116655,0.8932621113106886,0.9970612124862182,upscale
Min,15.031372783166521,0.8690245937785246,0.988221041018509,upscale
Mean,15.754583745205164,0.8816660630145009,0.9954295389393575,upscale
Max,10.443139841675473,0.6091922852035371,0.9829106123999645,gaussblurr
Min,10.201478958367687,0.5825154525272552,0.9646565357968153,gaussblurr
Mean,10.397684521468678,0.5953705954389401,0.9756193277652088,gaussblurr
Max,19.791904883253295,0.8835783808786187,0.9713356739474295,saltpepper
Min,18.18622575238622,0.8462089139261492,0.9580799217774375,saltpepper
Mean,19.106710285341684,0.8702052206763204,0.9659044893929465,saltpepper
Max,10.76901340427191,0.6187860605122851,0.7771354985094722,jpeg30
Min,9.269632568616938,0.47135393927134844,0.7046114135688795,jpeg30
Mean,10.16369039285025,0.5619785410190687,0.74182530730902,jpeg30
Max,12.849209110202711,0.719682734638026,0.8779908321044042,jpeg40
Min,11.982336573448329,0.6702113440967983,0.8186241403906847,jpeg40
Mean,12.402727931990198,0.6890309653612461,0.8464612838874033,jpeg40
Max,14.646522745058274,0.7777990058701897,0.9172362423195078,jpeg50
Min,13.525978314931939,0.7375867489640083,0.8744402788119331,jpeg50
Mean,13.990089799742833,0.7554071080755151,0.8948424963546457,jpeg50
Max,16.570881814279627,0.8271839632815109,0.9459693499928101,jpeg60
Min,14.62268105190119,0.7629765088278967,0.9019415934640603,jpeg60
Mean,15.721655901212575,0.8043607989970459,0.9293598063179588,jpeg60
Max,19.18189814000128,0.8654405627698694,0.9691015611556628,jpeg70
Min,16.134126573622986,0.8026675681308847,0.9327877652226646,jpeg70
Mean,17.8333282228742,0.8401581428746687,0.9560769547547978,jpeg70
Max,21.61874301030093,0.8982338654204951,0.9826980419854315,jpeg80
Min,17.583857820199473,0.8299736330737154,0.9533525438900574,jpeg80
Mean,19.963098824267465,0.8683732105115082,0.9728981732857046,jpeg80
Max,28.102185473495126,0.9278013828475009,0.99611077371158,jpeg95
Min,22.70151246554316,0.9001067611110328,0.9859008923984267,jpeg95
Mean,25.831624032076668,0.9152806719665579,0.9929820989986669,jpeg95
Max,11.315497315107365,0.6611263184869824,0.9994535516990026,bright05
Min,11.010891402769525,0.6481832302034419,0.9913938945274224,bright05
Mean,11.28415746172534,0.6587183963188633,0.9988713556734621,bright05
Max,13.25501469312647,0.7896505824053053,0.9996213654991593,bright06
Min,12.75841359794095,0.7751233193714091,0.9915560589256791,bright06
Mean,13.205817143797727,0.7866635331808675,0.9990483163546646,bright06
Max,15.772902082311294,0.8841798404126718,0.9996723038805864,bright07
Min,14.9390284173761,0.8701190087886448,0.9916571702031455,bright07
Mean,15.67438727961341,0.8809552602331483,0.9990841823534021,bright07
Max,19.266970549042554,0.9452808707932322,0.999701909397461,bright08
Min,17.741709549626606,0.9325922324855044,0.9916704704074037,bright08
Mean,19.119844079786372,0.942299568765354,0.9991177422975129,bright08
Max,25.202541273399653,0.9766288632560043,0.9997095244002476,bright09
Min,21.464493584356884,0.9648081760928701,0.9917503825932737,bright09
Mean,24.841332116504056,0.9738493501482464,0.999137093584521,bright09
Max,29.944520231627948,0.9758306709933393,0.9984132533212422,bright11
Min,25.106523291413097,0.9564276170721632,0.9920042283920192,bright11
Mean,29.272953408487943,0.9703236263854231,0.9976136817905069,bright11
Max,26.87726189628995,0.9646362095207254,0.9966816948531718,bright12
Min,13.947314265931388,0.7946194188827086,0.8865844457137657,bright12
Mean,22.871136471389246,0.9155965466135666,0.977619806793093,bright12
Max,24.184520011076014,0.9519340348248466,0.9935488733506244,bright13
Min,8.868192609543446,0.54693799548989,0.6246834254604023,bright13
Mean,16.757989584633833,0.7997534714484453,0.9116364651462444,bright13
Max,26.58728119855465,0.9416892089072141,0.9948179524310533,bright14
Min,7.769502046665545,0.31380454448772993,0.511706281488784,bright14
Mean,14.159920233021293,0.6788151290124818,0.8441521336390829,bright14
Max,24.820981689748095,0.9335990600872422,0.9913566277981409,bright15
Min,6.749011621897263,0.12748100116202943,0.47400743836770903,bright15
Mean,12.386751495832947,0.5932771188322825,0.7860788595483243,bright15
Max,12.298336412169139,0.7458133044862781,0.8445423850599459,crop25UL
Min,12.07029911051563,0.7366052574732436,0.8362572860744371,crop25UL
Mean,12.25420403553365,0.7417102222182025,0.8428305085780929,crop25UL
Max,41.02752504604772,0.9871698859122401,0.999813046615389,crop25W
Min,25.068285047842384,0.9779327610971816,0.9918956838767445,crop25W
Mean,39.05991711586947,0.9841190659609348,0.9992461098853164,crop25W
7 changes: 7 additions & 0 deletions coverdata.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
METRIC,PSNR,SSIM,CC,DATASET
Max,40.86297679,0.983252489,0.999381129,SIPI
Min,37.42230694,0.956893649,0.995526841,SIPI
Mean,39.29749284,0.97397383,0.997915209,SIPI
Max,40.862976791801245,0.9832524892556972,0.9993811288816858,SIPI
Min,37.42230694013433,0.9568936492232867,0.9955268406692906,SIPI
Mean,39.29749283694743,0.9739738302821098,0.9979152088287259,SIPI
145 changes: 99 additions & 46 deletions impercepCOVER.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 14,
"id": "39c19660",
"metadata": {},
"outputs": [],
Expand All @@ -14,43 +14,51 @@
"import threading\n",
"from queue import Queue\n",
"from skimage.metrics import structural_similarity as ssim\n",
"from skimage.metrics import peak_signal_noise_ratio as psnr"
"from skimage.metrics import peak_signal_noise_ratio as psnr\n",
"\n",
"datasetNAME = 'SIPI'"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "9dd0a935",
"execution_count": 15,
"id": "37faf688-c42a-49bd-a7ad-dcce66a0f797",
"metadata": {},
"outputs": [],
"source": [
"def toprint(df):\n",
" columns_to_analyze = df.columns[1:] # Start from the 2nd column (Column2)\n",
"\n",
" max_values = df[columns_to_analyze].max()\n",
" min_values = df[columns_to_analyze].min()\n",
" mean_values = df[columns_to_analyze].mean()\n",
" \n",
" # Create a new DataFrame with max, min, and mean values\n",
" output_df = pd.DataFrame({\n",
" 'Metric': ['Max', 'Min', 'Mean'],\n",
" 'PSNR': [max_values['PSNR'], min_values['PSNR'], mean_values['PSNR']],\n",
" 'SSIM': [max_values['SSIM'], min_values['SSIM'], mean_values['SSIM']],\n",
" 'CC': [max_values['CC'], min_values['CC'], mean_values['CC']]\n",
" })\n",
" \n",
" # Add a new column 'Dataset' with value 'newdata01'\n",
" output_df['Dataset'] = datasetNAME\n",
" output_df.to_csv('coverdata.csv', mode='a', header=False, index=False)\n",
"\n",
" print(\"Maximum values:\")\n",
" print(max_values)\n",
" print(\"\\nMinimum values:\")\n",
" print(min_values)\n",
" print(\"\\nMean values:\")\n",
" print(mean_values)"
" return output_df"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"id": "f6cadd04",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: total: 12.8 s\n",
"Wall time: 1.15 s\n"
"CPU times: total: 11.2 s\n",
"Wall time: 1.16 s\n"
]
}
],
Expand Down Expand Up @@ -121,46 +129,91 @@
},
{
"cell_type": "code",
"execution_count": 8,
"id": "7c18217d",
"execution_count": 6,
"id": "4d07eccb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Maximum values:\n",
"PSNR 40.862977\n",
"SSIM 0.983252\n",
"CC 0.999381\n",
"dtype: float64\n",
"\n",
"Minimum values:\n",
"PSNR 37.422307\n",
"SSIM 0.956894\n",
"CC 0.995527\n",
"dtype: float64\n",
"\n",
"Mean values:\n",
"PSNR 39.297493\n",
"SSIM 0.973974\n",
"CC 0.997915\n",
"dtype: float64\n"
]
}
],
"outputs": [],
"source": [
"toprint(df)"
"df.to_csv('filecover.csv')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "4d07eccb",
"execution_count": 21,
"id": "2a67abc7-6e85-4079-bfa4-9f8d300ab4ee",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Metric</th>\n",
" <th>PSNR</th>\n",
" <th>SSIM</th>\n",
" <th>CC</th>\n",
" <th>Dataset</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Max</td>\n",
" <td>40.862977</td>\n",
" <td>0.983252</td>\n",
" <td>0.999381</td>\n",
" <td>SIPI</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Min</td>\n",
" <td>37.422307</td>\n",
" <td>0.956894</td>\n",
" <td>0.995527</td>\n",
" <td>SIPI</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Mean</td>\n",
" <td>39.297493</td>\n",
" <td>0.973974</td>\n",
" <td>0.997915</td>\n",
" <td>SIPI</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Metric PSNR SSIM CC Dataset\n",
"0 Max 40.862977 0.983252 0.999381 SIPI\n",
"1 Min 37.422307 0.956894 0.995527 SIPI\n",
"2 Mean 39.297493 0.973974 0.997915 SIPI"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.to_csv('filecover.csv')"
"toprint(df)"
]
}
],
Expand Down
Loading

0 comments on commit 5930e3c

Please sign in to comment.