% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/classify-from-photos.R
\name{classify_from_photos}
\alias{classify_from_photos}
\title{Classify a soil profile from field photographs alone}
\usage{
classify_from_photos(
  images,
  lat = NULL,
  lon = NULL,
  country = NULL,
  provider = NULL,
  systems = c("wrb", "sibcs", "usda"),
  soilgrids = TRUE,
  depth_profiles = NULL,
  on_missing = "silent"
)
}
\arguments{
\item{images}{Either a character vector of profile-photo paths, or a
named list with elements \code{profile} (character vector,
required) and \code{fieldsheet} (character vector, optional).}

\item{lat, lon}{Optional decimal-degree coordinates. When supplied they
seed \code{pedon$site} and are used for the SoilGrids fetch; a
field sheet can also supply them through extraction.}

\item{country}{Optional ISO-2 country code; passed through to the
constructed pedon's site metadata.}

\item{provider}{A vision-language provider: an \pkg{ellmer} chat object
for live use, or a \code{MockVLMProvider} for testing and
offline demos. Required -- there is no default, so a real
classification is never produced from canned data by accident.}

\item{systems}{Character vector, any subset of \code{c("wrb", "sibcs",
"usda")}.}

\item{soilgrids}{If \code{TRUE} (default) missing horizon attributes are
back-filled from a SoilGrids depth prior via
\code{\link{apply_soilgrids_depth_prior}}.}

\item{depth_profiles}{Optional named list of six-slice SoilGrids depth
profiles, forwarded to \code{\link{apply_soilgrids_depth_prior}}.
Supplying it skips the network call.}

\item{on_missing}{Forwarded to the classifiers; default \code{"silent"}.}
}
\value{
A named list with one \code{\link{ClassificationResult}} per
        requested system (\code{$wrb}, \code{$sibcs}, \code{$usda}),
        the constructed \code{$pedon}, its \code{$provenance} ledger,
        and a one-row \code{$summary} data frame. If extraction yields
        no horizons the list instead carries \code{$error} and a
        \code{NULL} pedon.
}
\description{
A no-lab-data pipeline: profile photographs are sent to a vision-language
model for Munsell-colour and (optionally) site-metadata extraction; the
missing horizon attributes are back-filled from a SoilGrids depth prior;
and the WRB 2022, SiBCS 5 and USDA Soil Taxonomy keys are run on the
assembled \code{\link{PedonRecord}}.
}
\details{
Because every value originates from a photograph or a spatial prior, the
classification's evidence grade is low by construction (\code{D} for
VLM-extracted attributes, \code{C} where a SoilGrids prior contributed).
The result is a screening estimate, not a substitute for a described and
sampled profile.
}
\examples{
\dontrun{
# Live use with an ellmer chat:
res <- classify_from_photos(
  images   = list(profile = "profile.jpg", fieldsheet = "sheet.jpg"),
  lat = -22.7, lon = -43.6, country = "BR",
  provider = ellmer::chat_anthropic())
res$wrb$name
res$wrb$evidence_grade   # "D" or "C"
}
}
\seealso{
\code{\link{extract_munsell_from_photo}},
         \code{\link{apply_soilgrids_depth_prior}},
         \code{\link{compute_per_attribute_evidence_grade}}.
}
