Before anything, whether someone is guilty or innocent of a crime is an objective fact. During a legaltrial, what is known is presented to the court, thought about, and objectiveturned into a legal fact, which is incorporated in the legal fiction of the happenings1. Once the court decideshas the legal fiction of the transpiring, they craft a verdict that you are oneinnocent or the other, thatguilty. The verdict becomes a fact of law.
Legally speaking, the person accused of a crime always has been innocent or guilty since the moment the crime happened. If a higher court overrules a lower one, then that decision is just as retroactive - and you had been whatever the highest ruling court decreed you to be from the start.
Now, since a verdict of guilt and innocence are the possible outcomes of the trial, there must be a way for the court to find out what the fact is. That is what happens in the trial itself. In this context, the sentence "innocent until proven guilty" comes in, or rather "presumed innocent until proven guilty" does. The stress on presumption here is not just semantics: it is critical because it is how to deal with someone before and during the trial, which is where someone is proven guilty.
1 - Legal Fact is any single thing that is proven in the court. Together the legal facts make up the description of what the court thinks has transpired. That can be different from what actually happened. This can happen if things are not proven or mentioned they might be missing in the court's situational image. The totality of legal facts can be called Legal Fiction too.