Modificar README.md
This commit is contained in:
@@ -90,11 +90,7 @@ mode for backward compatibility with the current library.
|
|||||||
```python
|
```python
|
||||||
from spectralforensics import extract_rgb_features
|
from spectralforensics import extract_rgb_features
|
||||||
|
|
||||||
rgb_features = extract_rgb_features(
|
rgb_features = extract_rgb_features("images/sample.jpg",output="quantitative",)
|
||||||
"images/sample.jpg",
|
|
||||||
output="quantitative",
|
|
||||||
)
|
|
||||||
|
|
||||||
print(rgb_features["color_mode"])
|
print(rgb_features["color_mode"])
|
||||||
print(rgb_features["spectral_entropy"])
|
print(rgb_features["spectral_entropy"])
|
||||||
print(rgb_features["mean_gradient"])
|
print(rgb_features["mean_gradient"])
|
||||||
@@ -106,11 +102,7 @@ print(rgb_features["residual_noise_std_global"])
|
|||||||
```python
|
```python
|
||||||
from spectralforensics import extract_grayscale_features
|
from spectralforensics import extract_grayscale_features
|
||||||
|
|
||||||
grayscale_features = extract_grayscale_features(
|
grayscale_features = extract_grayscale_features("images/sample.jpg",output="quantitative",)
|
||||||
"images/sample.jpg",
|
|
||||||
output="quantitative",
|
|
||||||
)
|
|
||||||
|
|
||||||
print(grayscale_features["color_mode"])
|
print(grayscale_features["color_mode"])
|
||||||
print(grayscale_features["spectral_entropy"])
|
print(grayscale_features["spectral_entropy"])
|
||||||
print(grayscale_features["mean_gradient"])
|
print(grayscale_features["mean_gradient"])
|
||||||
@@ -125,19 +117,8 @@ the requested descriptors.
|
|||||||
```python
|
```python
|
||||||
from spectralforensics import extract_features
|
from spectralforensics import extract_features
|
||||||
|
|
||||||
rgb_data = extract_features(
|
rgb_data = extract_features("images/",color_mode="rgb",output="quantitative",output_csv="rgb_features.csv",)
|
||||||
"images/",
|
grayscale_data = extract_features("images/",color_mode="grayscale",output="quantitative",output_csv="grayscale_features.csv",)
|
||||||
color_mode="rgb",
|
|
||||||
output="quantitative",
|
|
||||||
output_csv="rgb_features.csv",
|
|
||||||
)
|
|
||||||
|
|
||||||
grayscale_data = extract_features(
|
|
||||||
"images/",
|
|
||||||
color_mode="grayscale",
|
|
||||||
output="quantitative",
|
|
||||||
output_csv="grayscale_features.csv",
|
|
||||||
)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
For a folder, `extract_features` returns a pandas `DataFrame`. Folder traversal
|
For a folder, `extract_features` returns a pandas `DataFrame`. Folder traversal
|
||||||
@@ -293,11 +274,7 @@ other inputs supported by `pandas.DataFrame`.
|
|||||||
```python
|
```python
|
||||||
from spectralforensics import box_plot, line_plot
|
from spectralforensics import box_plot, line_plot
|
||||||
|
|
||||||
data = {
|
data = {"sample": [1, 2, 3, 4, 5],"spectral_entropy": [2.1, 2.5, 2.2, 2.9, 2.6],"anisotropy": [0.10, 0.30, 0.20, 0.40, 0.25],}
|
||||||
"sample": [1, 2, 3, 4, 5],
|
|
||||||
"spectral_entropy": [2.1, 2.5, 2.2, 2.9, 2.6],
|
|
||||||
"anisotropy": [0.10, 0.30, 0.20, 0.40, 0.25],
|
|
||||||
}
|
|
||||||
|
|
||||||
line_plot(data, x="sample", y="spectral_entropy")
|
line_plot(data, x="sample", y="spectral_entropy")
|
||||||
box_plot(data, x="sample", y="anisotropy")
|
box_plot(data, x="sample", y="anisotropy")
|
||||||
@@ -309,33 +286,15 @@ box_plot(data, x="sample", y="anisotropy")
|
|||||||
Available plotting functions:
|
Available plotting functions:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from spectralforensics import (
|
from spectralforensics import (bar_plot,box_plot,correlation_plot,line_plot,scatter_plot,)
|
||||||
bar_plot,
|
|
||||||
box_plot,
|
|
||||||
correlation_plot,
|
|
||||||
line_plot,
|
|
||||||
scatter_plot,
|
|
||||||
)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Correlation analysis
|
### Correlation analysis
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from spectralforensics import correlation_plot
|
from spectralforensics import correlation_plot
|
||||||
|
correlation_data = {"spectral_entropy": [2.1, 2.5, 2.2, 2.9, 2.6],"anisotropy": [0.10, 0.30, 0.20, 0.40, 0.25],"target": [0, 1, 0, 1, 1],}
|
||||||
correlation_data = {
|
correlation_plot(correlation_data,correlation_columns=["spectral_entropy", "anisotropy", "target"],method="pearson",target="target",kind="barh",)
|
||||||
"spectral_entropy": [2.1, 2.5, 2.2, 2.9, 2.6],
|
|
||||||
"anisotropy": [0.10, 0.30, 0.20, 0.40, 0.25],
|
|
||||||
"target": [0, 1, 0, 1, 1],
|
|
||||||
}
|
|
||||||
|
|
||||||
correlation_plot(
|
|
||||||
correlation_data,
|
|
||||||
correlation_columns=["spectral_entropy", "anisotropy", "target"],
|
|
||||||
method="pearson",
|
|
||||||
target="target",
|
|
||||||
kind="barh",
|
|
||||||
)
|
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@@ -387,23 +346,19 @@ spectralforensics/
|
|||||||
|
|
||||||
## Research scope
|
## Research scope
|
||||||
|
|
||||||
SpectralForensics is a research and experimentation toolkit. Its descriptors
|
SpectralForensics is a research and experimentation toolkit. Its descriptors can support statistical analysis and machine-learning models, but they should not be treated as standalone proof that an image is authentic or generated.
|
||||||
can support statistical analysis and machine-learning models, but they should
|
|
||||||
not be treated as standalone proof that an image is authentic or generated.
|
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
|
|
||||||
- Jose Garcia
|
- Jose Garcia University of Leiria and Oeste (ULO)
|
||||||
- Patricio Rodrigues
|
- Patricio Rodrigues University of Leiria and Oeste (ULO)
|
||||||
- Carlos Grilo
|
- Carlos Grilo University of Leiria and Oeste (ULO)
|
||||||
- Rolando Miragaia
|
- Rolando Miragaia University of Leiria and Oeste (ULO)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Issues, suggestions, and contributions are welcome. For substantial changes,
|
Contribuições?
|
||||||
open an issue first to discuss the approach and its impact on the public API.
|
|
||||||
|
|
||||||
## Citation
|
## Citation
|
||||||
|
|
||||||
If you use SpectralForensics in academic work, cite the repository. A formal
|
Artigo?
|
||||||
citation and publication reference will be added as the project matures.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user