Modificar README.md
This commit is contained in:
@@ -53,7 +53,7 @@ The project is being developed to support research into AI-generated image detec
|
|||||||
Clone the repository and install it in editable mode:
|
Clone the repository and install it in editable mode:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone <your-repository-url>
|
git clone https://gittea.kl3z00.com/kl3z/spectralforensics
|
||||||
cd spectralforensics
|
cd spectralforensics
|
||||||
python -m pip install -e .
|
python -m pip install -e .
|
||||||
```
|
```
|
||||||
@@ -81,12 +81,7 @@ For a single image, `extract_features` returns a dictionary containing the file
|
|||||||
```python
|
```python
|
||||||
from spectralforensics import extract_features
|
from spectralforensics import extract_features
|
||||||
|
|
||||||
data = extract_features(
|
data = extract_features("images/", output_csv="spectral_features.csv",output="quantitative")
|
||||||
"images/",
|
|
||||||
output_csv="spectral_features.csv",
|
|
||||||
output="quantitative",
|
|
||||||
)
|
|
||||||
|
|
||||||
print(data.head())
|
print(data.head())
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -104,9 +99,7 @@ real_files = rename_real_images("dataset/real")
|
|||||||
generated_files = rename_generated_images("dataset/generated")
|
generated_files = rename_generated_images("dataset/generated")
|
||||||
```
|
```
|
||||||
|
|
||||||
The resulting filenames follow the `real1.jpg`, `real2.png`, `gen1.jpg`,
|
The resulting filenames follow the `real1.jpg`, `real2.png`, `gen1.jpg`, and `gen2.png` patterns. Each function returns a list of the new paths. Renaming is non-recursive and preserves each image format.
|
||||||
and `gen2.png` patterns. Each function returns a list of the new paths.
|
|
||||||
Renaming is non-recursive and preserves each image format.
|
|
||||||
|
|
||||||
## Extraction modes
|
## Extraction modes
|
||||||
|
|
||||||
@@ -121,15 +114,14 @@ Use the `output` argument to control which results are calculated and returned:
|
|||||||
| `"quantitative"` | All numerical descriptors, without visual maps |
|
| `"quantitative"` | All numerical descriptors, without visual maps |
|
||||||
| `"visual"` | Visual maps, without quantitative descriptors |
|
| `"visual"` | Visual maps, without quantitative descriptors |
|
||||||
|
|
||||||
|
|
||||||
|
The use `image_size` is set as default image_size=(255, 255); however, the module is designed to support other image dimensions.
|
||||||
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
features = extract_features(
|
features = extract_features("images/sample.jpg", image_size=(255, 255), high_freq_threshold=0.65, output="spectral", )
|
||||||
"images/sample.jpg",
|
|
||||||
image_size=(255, 255),
|
|
||||||
high_freq_threshold=0.65,
|
|
||||||
output="spectral",
|
|
||||||
)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If a filename contains `gen`, the generated-image target is set to `"0"`. If it contains `real`, the target is set to `"1"`; otherwise, the target is left as `None`.
|
If a filename contains `gen`, the generated-image target is set to `"0"`. If it contains `real`, the target is set to `"1"`; otherwise, the target is left as `None`.
|
||||||
@@ -141,11 +133,7 @@ The plotting functions accept dictionaries, pandas `DataFrame` objects, and othe
|
|||||||
```python
|
```python
|
||||||
from spectralforensics import line_plot, scatter_plot
|
from spectralforensics import line_plot, scatter_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")
|
||||||
scatter_plot(data, x="spectral_entropy", y="anisotropy")
|
scatter_plot(data, x="spectral_entropy", y="anisotropy")
|
||||||
@@ -218,10 +206,10 @@ SpectralForensics is intended as a research and experimentation toolkit. Extract
|
|||||||
|
|
||||||
## 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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user