Let $ A,B $ be two points in a plane and let two numbers $ a,b\in (0,1) . $ For each point $ M $ that is not on the line $ AB $ consider $ P $ on the segment $ AM $ and $ N $ on $ BM $ (both excluding the extremities) such that $ BN=b\cdot BM $ and $ AP=a\cdot AM. $ Find the locus of the points $ M $ for which $ AN=BP. $
1. **Define Coordinates:**
   Let \( A = (0, 0) \), \( B = (k, 0) \), and \( M = (x, y) \). We need to find the coordinates of points \( P \) and \( N \) based on the given conditions.

2. **Coordinates of \( P \) and \( N \):**
   - Point \( P \) lies on the segment \( AM \) such that \( AP = a \cdot AM \). Therefore, the coordinates of \( P \) are:
     \[
     P = (ax, ay)
     \]
   - Point \( N \) lies on the segment \( BM \) such that \( BN = b \cdot BM \). Therefore, the coordinates of \( N \) are:
     \[
     N = (k - b(k - x), by) = (k - kb + bx, by)
     \]

3. **Condition \( AN = BP \):**
   We need to find the locus of points \( M \) such that \( AN = BP \). Using the distance formula, we have:
   \[
   AN = \sqrt{(k - kb + bx)^2 + (by)^2}
   \]
   \[
   BP = \sqrt{(k - ax)^2 + (ay)^2}
   \]
   Setting these distances equal gives:
   \[
   \sqrt{(k - kb + bx)^2 + b^2y^2} = \sqrt{(k - ax)^2 + a^2y^2}
   \]

4. **Square Both Sides:**
   To eliminate the square roots, square both sides:
   \[
   (k - kb + bx)^2 + b^2y^2 = (k - ax)^2 + a^2y^2
   \]

5. **Expand and Simplify:**
   Expanding both sides:
   \[
   (k - kb + bx)^2 + b^2y^2 = k^2 - 2kkb + k^2b^2 + b^2x^2 + 2kbx - 2k^2b + b^2y^2
   \]
   \[
   (k - ax)^2 + a^2y^2 = k^2 - 2kax + a^2x^2 + a^2y^2
   \]
   Simplifying, we get:
   \[
   k^2 - 2kkb + k^2b^2 + b^2x^2 + 2kbx - 2k^2b + b^2y^2 = k^2 - 2kax + a^2x^2 + a^2y^2
   \]

6. **Combine Like Terms:**
   Grouping like terms together:
   \[
   b^2x^2 - a^2x^2 + b^2y^2 - a^2y^2 + 2kbx - 2kax + k^2b^2 - 2k^2b = 0
   \]
   \[
   (b^2 - a^2)(x^2 + y^2) + 2k(b - a)x + k^2b^2 - 2k^2b = 0
   \]

7. **Analyze the Equation:**
   - If \( a \neq b \), the equation represents a circle. The general form of a circle is \( (x - h)^2 + (y - k)^2 = r^2 \), which indicates that the locus is a circle centered somewhere on the line \( AB \).
   - If \( a = b \), the equation simplifies to:
     \[
     2k(b - a)x = 0
     \]
     Since \( b = a \), this reduces to \( 0 = 0 \), which is always true. Therefore, the locus is a line that perpendicularly bisects the line segment \( AB \).

The final answer is the locus is a circle centered somewhere on \( \boxed{ AB } \) when \( a \neq b \), but is a line that perpendicularly bisects the line segment \( AB \) when \( a = b \).