LetS be a topological semigroup andAP(S) the space of continous complex almost periodic functions onS. We obtain characterizations of compact and weakly compact operators from a Banach spaceX into AP(S). For this we use the almost periodic compactification ofS obtained through uniform spaces. For a bounded linear operatorT fromX into AP(S), letT5, be the translate ofT bys inS defined byT5(x)=(Tx)5. We define topologies on the space of bounded linear operators fromX into AP(S) and obtain the necessary and sufficient conditions for an operatorT to be compact or weakly compact in terms of the uniform continuity of the maps→T5. IfS is a Hausdorff topological semigroup, we also obtain characterizations of compact and weakly compact multipliers on AP(S) in terms of the uniform continuity of the map S→μs, where μs denotes the unique vector measure corresponding to the operatorT5.